Re: [PATCH v1 07/13] iio: imu: adis16550: Simplify device abstraction

From: Jonathan Cameron

Date: Wed Jun 24 2026 - 13:47:37 EST


On Fri, 19 Jun 2026 17:54:35 +0200
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx> wrote:

> The driver supports a single chip variant only. Simplify the driver by
> hard-coding the device properties instead of using the id_table's
> abstraction for a single chip type and a lookup in a table with only one
> entry.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>

For this one I'd like some feedback from Analog people.

The reason being that we could do similar to Andy's suggestion for the
tsc2046 and rip out the chip_info structure in favour of hard coding everything
in there. However, if we know there are similar parts and that their is
some plan to add support for them - I'd rather not have the churn of ripping
it out only to revert a little later.

So Nuno, Michael etc, where do we think this one is going?

(and yes I'm too busy / lazy / behind on review to go look for parts that look similar!)

Jonathan


> ---
> drivers/iio/imu/adis16550.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/imu/adis16550.c b/drivers/iio/imu/adis16550.c
> index 75679612052f..0fd18e16942f 100644
> --- a/drivers/iio/imu/adis16550.c
> +++ b/drivers/iio/imu/adis16550.c
> @@ -1064,9 +1064,8 @@ static int adis16550_probe(struct spi_device *spi)
> return -ENOMEM;
>
> st = iio_priv(indio_dev);
> - st->info = spi_get_device_match_data(spi);
> - if (!st->info)
> - return -EINVAL;
> + st->info = &adis16550_chip_info;
> +
> adis = &st->adis;
> indio_dev->name = st->info->name;
> indio_dev->channels = st->info->channels;
> @@ -1117,13 +1116,13 @@ static int adis16550_probe(struct spi_device *spi)
> }
>
> static const struct spi_device_id adis16550_id[] = {
> - { "adis16550", (kernel_ulong_t)&adis16550_chip_info},
> + { .name = "adis16550" },
> { }
> };
> MODULE_DEVICE_TABLE(spi, adis16550_id);
>
> static const struct of_device_id adis16550_of_match[] = {
> - { .compatible = "adi,adis16550", .data = &adis16550_chip_info },
> + { .compatible = "adi,adis16550" },
> { }
> };
> MODULE_DEVICE_TABLE(of, adis16550_of_match);