Re: [PATCH 3/6] iio: adc: ad7266: drop platform data support

From: Andy Shevchenko

Date: Wed Nov 25 2026 - 06:19:29 EST


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?

--
With Best Regards,
Andy Shevchenko