Re: [PATCH v5 3/4] iio: adc: extract setup function without backend
From: Andy Shevchenko
Date: Mon Aug 25 2025 - 09:54:32 EST
On Mon, Aug 25, 2025 at 01:51:18PM +0300, Ioana Risteiu wrote:
> Refactor probe function by moving the initialization specific to
> communication without iio-backend into a separate setup function.
>
> The purpose of this modification is better code organization. No
> functional changes intended.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
But there is a nit-pick.
...
> indio_dev->name = st->chip_info->name;
> - indio_dev->info = &ad7779_info;
> indio_dev->modes = INDIO_DIRECT_MODE;
> - indio_dev->channels = st->chip_info->channels;
> indio_dev->num_channels = ARRAY_SIZE(ad7779_channels);
Hmm... Not sure about this split, as I would definitely keep logically coupled
things together, like channels and num_channels. Otherwise it will be harder
to maintain and more prone to subtle mistakes.
--
With Best Regards,
Andy Shevchenko