All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Biju Das" <biju.das.jz@bp.renesas.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Jean Delvare" <jdelvare@suse.de>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	linux-iio@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] iio: dac: ti-dac5571: Use i2c_get_match_data()
Date: Wed, 16 Aug 2023 10:16:00 +0200	[thread overview]
Message-ID: <CAMuHMdUVCS_D0SBtDBrLQbAkdt0ZUbMOca+ukdwUtnGqzUr+cA@mail.gmail.com> (raw)
In-Reply-To: <ZNusymsNh/zFgHg7@smile.fi.intel.com>

Hi Andy,

On Tue, Aug 15, 2023 at 6:50 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Tue, Aug 15, 2023 at 09:29:06AM +0200, Geert Uytterhoeven wrote:
> > On Tue, Aug 15, 2023 at 9:19 AM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Sat, Aug 12, 2023 at 10:04:18AM +0100, Biju Das wrote:
> > > > Replace device_get_match_data() and id lookup for retrieving match data
> > > > by i2c_get_match_data() by converting enum->pointer for data in the
> > > > match table.
>
> ...
>
> > > > +     {.compatible = "ti,dac5571", .data = &dac5571_spec[single_8bit] },
> > > > +     {.compatible = "ti,dac6571", .data = &dac5571_spec[single_10bit] },
> > > > +     {.compatible = "ti,dac7571", .data = &dac5571_spec[single_12bit] },
> > > > +     {.compatible = "ti,dac5574", .data = &dac5571_spec[quad_8bit] },
> > > > +     {.compatible = "ti,dac6574", .data = &dac5571_spec[quad_10bit] },
> > > > +     {.compatible = "ti,dac7574", .data = &dac5571_spec[quad_12bit] },
> > > > +     {.compatible = "ti,dac5573", .data = &dac5571_spec[quad_8bit] },
> > > > +     {.compatible = "ti,dac6573", .data = &dac5571_spec[quad_10bit] },
> > > > +     {.compatible = "ti,dac7573", .data = &dac5571_spec[quad_12bit] },
> > > > +     {.compatible = "ti,dac121c081", .data = &dac5571_spec[single_12bit] },
> > >
> > > I would reorder them a bit.
> >
> > Which is safe in this particular case...
> > But not in general, as there might be fall-back compatible values.
>
> You mean the OF ID list must be specifically ordered?! What a nice minefield!
> This has to be fixed somewhere else, surely.

Seems like it is, cfr. the scoring system in drivers/of/base.c
__of_device_is_compatible().  Sorry for the confusion.

I still tend to order them in match tables though, from most-specific
to least-specific.

Note that soc_device_match() (which is used less, fortunately) does
not have such a scoring system, so order does matter there.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2023-08-16  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12  9:04 [PATCH] iio: dac: ti-dac5571: Use i2c_get_match_data() Biju Das
2023-08-15  7:18 ` Andy Shevchenko
2023-08-15  7:29   ` Geert Uytterhoeven
2023-08-15 16:50     ` Andy Shevchenko
2023-08-16  8:16       ` Geert Uytterhoeven [this message]
2023-08-17 10:22         ` Andy Shevchenko
2023-08-17 11:51           ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUVCS_D0SBtDBrLQbAkdt0ZUbMOca+ukdwUtnGqzUr+cA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=jdelvare@suse.de \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.