Re: [PATCH] iio: dac: ti-dac5571: Use i2c_get_match_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Tue, Aug 15, 2023 at 6:50 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux