Re: [PATCH v1 1/4] iio: magnetometer: yamaha-yas530: Use pointers as driver data

From: Andy Shevchenko
Date: Mon Aug 29 2022 - 15:23:14 EST


On Mon, Aug 29, 2022 at 06:00:22PM +0100, Jonathan Cameron wrote:
> On Mon, 29 Aug 2022 14:24:04 +0300
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

...

> > - yas5xx->chip_info = &yas5xx_chip_info_tbl[id->driver_data];
> > - ci = yas5xx->chip_info;
> > + ci = device_get_match_data(dev);
> > + yas5xx->chip_info = ci;
>
> Am I missing a path by which device_get_match_data() can use the i2c_device_id values?
> I'd expect to see a fallback to that if ci == NULL to cover the non firmware causes
> of probe(). I've seen a few patches without that fallback path recently so wondering
> if some magic has gotten hooked up and I've missed it (something to push that via
> a swnode perhaps?)

No, there is no such magic behind. The idea is that we use DT / ACPI overlays when
device needs to be established. But I have got your point.


--
With Best Regards,
Andy Shevchenko