Re: [PATCH v1 5/5] mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing

From: Andy Shevchenko
Date: Tue Mar 23 2021 - 06:32:03 EST


On Tue, Mar 23, 2021 at 09:20:57AM +0000, Lee Jones wrote:
> On Tue, 02 Mar 2021, Andy Shevchenko wrote:
>
> > It's convenient and less error prone to use definitions to address
> > different cells in an array. For this purpose we may reuse existing
> > BAR definitions.

...

> > + {
> > + .id = MFD_GPIO_BAR,
> > + .name = "gpio-dwapb",
> > + .acpi_match = &intel_quark_acpi_match_gpio,
> > + .num_resources = ARRAY_SIZE(intel_quark_gpio_res),
> > + .resources = intel_quark_gpio_res,
> > + .ignore_resource_conflicts = true,
> > + },
> > };
>
> I would make this more explicit.
>
> [MFD_I2C_BAR] = { }
>
> If someone comes along and re-reorders these, it will break.

Agree.
Will do for v2.

--
With Best Regards,
Andy Shevchenko