[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d817f2c9-063f-4506-888f-f3c6faef53c4@baylibre.com>
Date: Thu, 14 Aug 2025 09:53:21 -0500
From: David Lechner <dlechner@...libre.com>
To: Matti Vaittinen <mazziesaccount@...il.com>,
Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Jonathan Cameron <jic23@...nel.org>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, David Heidelberg <david@...t.cz>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Sukrut Bellary <sbellary@...libre.com>,
Lothar Rubusch <l.rubusch@...il.com>
Subject: Re: [PATCH 2/3] iio: adc: adc128s052: Simplify matching chip_data
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@...il.com>
>
> ---
Reviewed-by: David Lechner <dlechner@...libre.com>
Powered by blists - more mailing lists