mfd: palmas: Make similar OF and ID table
authorBiju Das <biju.das.jz@bp.renesas.com>
Thu, 31 Aug 2023 18:31:53 +0000 (19:31 +0100)
committerLee Jones <lee@kernel.org>
Wed, 1 Nov 2023 10:02:10 +0000 (10:02 +0000)
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.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831183153.63750-5-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/palmas.c

index 3ac9dec2b117a1fa4f44900da40050275ef1d6c8..7fc886f4f80e62de2594fa9562ba8c78c6da945e 100644 (file)
@@ -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);