Message ID | 20230828153144.75479-3-biju.das.jz@bp.renesas.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Match data improvements for palmas driver | expand |
On Mon, Aug 28, 2023 at 04:31:44PM +0100, Biju Das wrote: > Make similar OF and ID table to extend support for ID match using > i2c_match_data(). Currently it works only for OF match tables as the > driver_data is wrong for ID match. ... > While at it, drop the inner leading commas for ID table. Are you sure? ------------------v > - { "palmas", }, > - { "twl6035", }, > - { "twl6037", }, > - { "tps65913", }, > + { "palmas", (kernel_ulong_t)&palmas_data }, > + { "twl6035", (kernel_ulong_t)&palmas_data }, > + { "twl6037", (kernel_ulong_t)&palmas_data }, > + { "tps65913", (kernel_ulong_t)&palmas_data },
Hi Andy Shevchenko, > Subject: Re: [PATCH v2 2/2] mfd: palmas: Make similar OF and ID table > > On Mon, Aug 28, 2023 at 04:31:44PM +0100, Biju Das wrote: > > Make similar OF and ID table to extend support for ID match using > > i2c_match_data(). Currently it works only for OF match tables as the > > driver_data is wrong for ID match. > > ... > > > While at it, drop the inner leading commas for ID table. > > Are you sure? Oops. Will drop it. Cheers, Biju > > ------------------v > > - { "palmas", }, > > - { "twl6035", }, > > - { "twl6037", }, > > - { "tps65913", }, > > + { "palmas", (kernel_ulong_t)&palmas_data }, > > + { "twl6035", (kernel_ulong_t)&palmas_data }, > > + { "twl6037", (kernel_ulong_t)&palmas_data }, > > + { "tps65913", (kernel_ulong_t)&palmas_data }, > > -- > With Best Regards, > Andy Shevchenko >
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 3ac9dec2b117..7fc886f4f80e 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -513,7 +513,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c) palmas->dev = &i2c->dev; palmas->irq = i2c->irq; - driver_data = device_get_match_data(&i2c->dev); + driver_data = i2c_get_match_data(i2c); palmas->features = driver_data->features; for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { @@ -699,10 +699,10 @@ static const struct of_device_id of_palmas_match_tbl[] = { MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); static const struct i2c_device_id palmas_i2c_id[] = { - { "palmas", }, - { "twl6035", }, - { "twl6037", }, - { "tps65913", }, + { "palmas", (kernel_ulong_t)&palmas_data }, + { "twl6035", (kernel_ulong_t)&palmas_data }, + { "twl6037", (kernel_ulong_t)&palmas_data }, + { "tps65913", (kernel_ulong_t)&palmas_data }, { /* end */ } }; MODULE_DEVICE_TABLE(i2c, palmas_i2c_id);
Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, drop the inner leading commas for ID table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- v1->v2: * Removed trailing comma in the terminator entry for ID table --- drivers/mfd/palmas.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)