Re: [PATCH v6 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support

From: Andy Shevchenko
Date: Wed Mar 29 2023 - 10:46:26 EST


On Wed, Mar 29, 2023 at 03:36:15PM +0100, Lee Jones wrote:
> On Tue, 28 Mar 2023, Sahin, Okan wrote:
> > >On Wed, 15 Mar 2023, Lee Jones wrote:
> > >> On Tue, 07 Mar 2023, Okan Sahin wrote:

...

> > +static const struct i2c_device_id max77541_i2c_id[] = {
> > + { "max77540", (kernel_ulong_t)&chip[MAX77540] },
> > + { "max77541", (kernel_ulong_t)&chip[MAX77541] },
>
> Just 'MAX77540' is fine.

I tend to disagree.

There is an error prone approach esp. when we talk with some functions
that unifies OF/ACPI driver data retrieval with legacy ID tables.
In such a case the 0 from enum is hard to distinguish from NULL when
the driver data is not set or not found. On top of that the simple integer
in the legacy driver data will require additional code to be added in
the ->probe().

--
With Best Regards,
Andy Shevchenko