Re: [PATCH v2 06/11] iio: adc: ad7793: use spi_get_device_match_data()
From: Andy Shevchenko
Date: Thu Dec 03 2026 - 11:38:49 EST
On Wed, Dec 02, 2026 at 05:05:38PM +0000, Nuno Sá wrote:
> The chip info is looked up by indexing the chip info table with the
> driver data of the matched SPI device id, assuming spi_get_device_id()
> always finds a match. That is not guaranteed, e.g. when the device is
> bound through driver_override.
>
> Store the part name in struct ad7793_chip_info, point the SPI device id
> table entries to the chip info and get it with
> spi_get_device_match_data(). This also prepares for the upcoming
> firmware support, as the same chip info can then be provided by an OF
> match table.
...
> - st->chip_info =
> - &ad7793_chip_info_tbl[spi_get_device_id(spi)->driver_data];
> + st->chip_info = spi_get_device_match_data(spi);
> + if (!st->chip_info)
> + return -ENODEV;
-ENODATA
...
With the above being addressed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko