[PATCH v4 0/4] Simplify obtaining I2C match data
This patch series aims to simplify obtaining I2C match data.
This patch series is only compile tested.
v4: * Added as a series * Updated commit header for all patches * Updated commit description for patch#1.
Biju Das (4): mfd: arizona-i2c: Simplify obtaining I2C match data mfd: madera-i2c: Simplify obtaining I2C match data mfd: max77541: Simplify obtaining I2C match data mfd: max8998: Simplify obtaining I2C match data and drop max8998_i2c_get_driver_data()
drivers/mfd/arizona-i2c.c | 11 ++--------- drivers/mfd/madera-i2c.c | 9 +-------- drivers/mfd/max77541.c | 6 +----- drivers/mfd/max8998.c | 12 +----------- 4 files changed, 5 insertions(+), 33 deletions(-)
Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data().
Signed-off-by: Biju Das biju.das.jz@bp.renesas.com Acked-by: Charles Keepax ckeepax@opensource.cirrus.com --- Note: This patch is only compile tested.
v3->v4: * Updated commit header. v2->v3: * Used uintptr_t for enum casting. v1->v2: * Added Ack tag from Charles Keepax. * Dropped blank line before switch statement. --- drivers/mfd/madera-i2c.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/mfd/madera-i2c.c b/drivers/mfd/madera-i2c.c index a404ea26bc79..0986e4a99f4a 100644 --- a/drivers/mfd/madera-i2c.c +++ b/drivers/mfd/madera-i2c.c @@ -18,21 +18,14 @@
static int madera_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); struct madera *madera; const struct regmap_config *regmap_16bit_config = NULL; const struct regmap_config *regmap_32bit_config = NULL; - const void *of_data; unsigned long type; const char *name; int ret;
- of_data = of_device_get_match_data(&i2c->dev); - if (of_data) - type = (unsigned long)of_data; - else - type = id->driver_data; - + type = (uintptr_t)i2c_get_match_data(i2c); switch (type) { case CS47L15: if (IS_ENABLED(CONFIG_MFD_CS47L15)) {
On Sat, 23 Sep 2023 18:49:24 +0100, Biju Das wrote:
This patch series aims to simplify obtaining I2C match data.
This patch series is only compile tested.
v4:
- Added as a series
- Updated commit header for all patches
- Updated commit description for patch#1.
[...]
Applied, thanks!
[1/4] mfd: arizona-i2c: Simplify obtaining I2C match data commit: 33b5b46a3bd2664a32568f7df2c7b5fd9d2873ae [2/4] mfd: madera-i2c: Simplify obtaining I2C match data commit: 7a6ff7d69d9921d269b796ca0c2a96717563fe84 [3/4] mfd: max77541: Simplify obtaining I2C match data commit: 9abf37d4bbb20d6fb6e15a73d8e8247c8e791f46 [4/4] mfd: max8998: Simplify obtaining I2C match data and drop max8998_i2c_get_driver_data() commit: 36270a2599628fbd8052b3d9241f4a4b02faea7c
-- Lee Jones [李琼斯]
participants (2)
-
Biju Das
-
Lee Jones