[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260205201844.01efba05@jic23-huawei>
Date: Thu, 5 Feb 2026 20:18:44 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, kernel@...gutronix.de, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org, Andy Shevchenko
<andy@...nel.org>, David Lechner <dlechner@...libre.com>, Nuno
Sá <nuno.sa@...log.com>, David Jander <david@...tonic.nl>
Subject: Re: [PATCH v5 06/13] iio: dac: ds4424: use device match data for
chip info
On Wed, 4 Feb 2026 16:20:13 +0200
Andy Shevchenko <andriy.shevchenko@...el.com> wrote:
> On Wed, Feb 04, 2026 at 03:00:38PM +0100, Oleksij Rempel wrote:
> > Refactor the driver to use device match data instead of checking ID enums
> > in a switch statement.
> >
> > Define a `ds4424_chip_info` structure to hold variant-specific attributes
> > (currently just the channel count) and attach it directly to the I2C and
> > OF device ID tables.
> >
> > This simplifies the probe function and makes it easier to add support for
> > new variants like DS4402/DS4404.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
> with a hope that we get rid an I²C ID requirement at some point.
>
> ...
>
> > +struct ds4424_chip_info {
> > + u8 num_channels;
>
> If you wish, you can provide name here that will go to ->name field.
> Linker dedups string literals, so it will be just an additional runtime
> pointer.
I'd prefer we did this now. That avoids any future issue where we get
subtle mismatches between DT compatibles listed and the i2c_device_id
names.
We've been bitten by bugs around this before, hence tend to push names
into the chip_info structure instead of using id->name. IIRC correctly
the fun starts when we have a fallback compatible.
Jonathan
>
> > +};
>
Powered by blists - more mailing lists