Re: [PATCH RFC 3/4] i2c: mux: pca954x: convert to using a pointer in i2c_device_id

From: Andy Shevchenko
Date: Tue Aug 15 2023 - 11:52:48 EST


On Mon, Aug 14, 2023 at 02:52:51PM -0700, Dmitry Torokhov wrote:
> Switch the driver to use newly added "data" pointer in i2c_device_id to
> streamline DT and legacy flows.

...

> @@ -206,7 +206,7 @@ static const struct of_device_id pca954x_of_match[] = {
> { .compatible = "nxp,pca9847", .data = &chips[pca_9847] },
> { .compatible = "nxp,pca9848", .data = &chips[pca_9848] },
> { .compatible = "nxp,pca9849", .data = &chips[pca_9849] },
> - {}
> + { }
> };
> MODULE_DEVICE_TABLE(of, pca954x_of_match);

Stray change.

...

> data->chip = device_get_match_data(dev);
> if (!data->chip)
> - data->chip = &chips[id->driver_data];
> + data->chip = id->data;

Same, why not to use that helper and if anything, modify it instead.

--
With Best Regards,
Andy Shevchenko