Re: [PATCH 3/6] iio: adc: ad7266: drop platform data support
From: Nuno Sá
Date: Thu Nov 26 2026 - 05:29:55 EST
On Wed, Nov 25, 2026 at 12:38:38PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 25, 2026 at 10:19:19AM +0000, Nuno Sá wrote:
> > There are no in-tree users of struct ad7266_platform_data. Without it,
> > the driver already falls back to a fixed address, differential mode
> > and the 0V - VREF input range.
> >
> > Drop the platform data header and move the range and mode enums into
> > the driver. The code for the address GPIOs, the pseudo differential and
> > single-ended modes and the 0V - 2VREF range is kept so it can be
> > enabled again should someone need it and add firmware properties for
> > it.
>
> ...
>
> > + /*
> > + * The address GPIOs, the other sample modes and the 0V - 2VREF range
> > + * could only be selected through platform data, which had no users.
> > + * Keep the support around in case someone needs it and adds firmware
> > + * properties for it.
> > + */
>
> Same comment about the comment.
>
> ...
>
> > + if (!st->fixed_addr) {
> > + for (i = 0; i < ARRAY_SIZE(st->gpios); ++i) {
> > + st->gpios[i] = devm_gpiod_get(&spi->dev,
> > ad7266_gpio_labels[i],
> > GPIOD_OUT_LOW);
> > + if (IS_ERR(st->gpios[i]))
> > + return PTR_ERR(st->gpios[i]);
> > }
>
> Side note: Have you considered switching to GPIO array APIs?
Nope. One thing I've stated in the cover is that I really don't to fall
into a refactor trap. All of these are fairly old drivers so I'm sure
there's a lot of things to improve. I just don't have the bandwidth.
Even with AI :).
- Nuno Sá
>
> --
> With Best Regards,
> Andy Shevchenko
>
>