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

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

 



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.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux