Re: [PATCH v2 05/10] iio: adc: ad7476: Limit the scope of the chip_info
From: Matti Vaittinen
Date: Fri Aug 08 2025 - 01:22:57 EST
On 08/08/2025 00:12, Andy Shevchenko wrote:
On Thu, Aug 7, 2025 at 11:34 AM Matti Vaittinen
<mazziesaccount@xxxxxxxxx> wrote:
The chip_info structure is not required to be accessed after probe.
Remove the chip_info pointer from the driver data to reduce the scope
and to make driver clearer.
the driver
clearer or cleaner? I think you want the latter...
I actually think both :)
...
Not sure how the future of the development of this driver will look
like, but it might be this patch will be reverted if one wants
something else from chip_info to have a longer lifetime.
Nuno had the same comment. I kind of like the idea of only having those
bits of chip_info that are used after probe, stored in the "state
struct". Or, to reverse this, I don't like having the unused (after the
probe) data stored in the state struct. For me it is both clearer, and
cleaner.
But yes, as You and Nuno pointed out, this leads to some data
duplication. If the opinions were "1 against 1", I would try discussing
this - but meh, I'll drop this as you both suggested.
Thanks for the review Nuno & Andy.
Yours,
-- Matti