Re: [PATCH v1 06/13] iio: frequency: ad9523: Simplify driver a bit

From: Jonathan Cameron

Date: Wed Jun 24 2026 - 13:44:16 EST


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

> spi driver data is only set but never used, so the assignment can be
> dropped. Also the spi id_table's .driver_data is unused and can be
> dropped.
>
> While touching the spi id_table modify it to use a named initializer.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>

Whilst you are here I think it makes sense to at least set the
appropriate leg of:
indio_dev->name = (pdata->name[0] != 0) ? pdata->name :
spi_get_device_id(spi)->name;
to the name string directly rather than via the spi_device_id.

Maybe that's a job for someone who is ripping out the all the pdata in favour of
a device tree binding. Ok I've argued myself into picking this up as it stands
on basis that change probably fits better in a separate rather more complex
series.

ADI people, is this one on your list to either modernize, or potentially drop?

In mean time I've applied this.

Thanks,

Jonathan


> ---
> drivers/iio/frequency/ad9523.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/frequency/ad9523.c b/drivers/iio/frequency/ad9523.c
> index ea4d2763564a..1e393f40a8c8 100644
> --- a/drivers/iio/frequency/ad9523.c
> +++ b/drivers/iio/frequency/ad9523.c
> @@ -990,7 +990,6 @@ static int ad9523_probe(struct spi_device *spi)
> if (IS_ERR(st->sync_gpio))
> return PTR_ERR(st->sync_gpio);
>
> - spi_set_drvdata(spi, indio_dev);
> st->spi = spi;
> st->pdata = pdata;
>
> @@ -1009,7 +1008,7 @@ static int ad9523_probe(struct spi_device *spi)
> }
>
> static const struct spi_device_id ad9523_id[] = {
> - {"ad9523-1", 9523},
> + { .name = "ad9523-1" },
> { }
> };
> MODULE_DEVICE_TABLE(spi, ad9523_id);