Re: [PATCH 2/3] iio: adc: adc128s052: Simplify matching chip_data

From: Jonathan Cameron
Date: Sat Aug 16 2025 - 08:28:40 EST


On Thu, 14 Aug 2025 09:53:21 -0500
David Lechner <dlechner@xxxxxxxxxxxx> wrote:

> On 8/14/25 3:35 AM, Matti Vaittinen wrote:
> > The adc128s052 driver supports a few different ICs. IC specific
> > configuration data is stored in an array. IC data, residing in a
> > specific point of the array, is pointed from the SPI device match data.
> >
> > There is no need to have the chip config data structures in an array
> > and splitting them out of an array has at least following benefits:
> >
> > - Chip-specific structures can be named after the chips they support.
> > This makes referring them a tad cleaner, compared to using a generic
> > array name with a numerical index.
> >
> > - Avoid all potential 'out of bounds' errors which can result if the
> > array is changed.
> >
> > Split the chip configuration data array to individual structures.
> >
> > Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
> >
> > ---
> Reviewed-by: David Lechner <dlechner@xxxxxxxxxxxx>
>
Any racing series get to rebase on top of this.

Applied this patch as it is good in it's own right.

Thanks,

Jonathan