Skip to contentSkip to conversation

mfd: rohm-bdXXX - switch to use i2c probe_new

PATCH In review Matti Vaittinen 2 participants 6 messages Mar 26, 2020 – Apr 16, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: rohm-bdXXX - switch to use i2c probe_new

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

---
 drivers/mfd/rohm-bd70528.c | 5 ++---
 drivers/mfd/rohm-bd718x7.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/mfd/rohm-bd70528.c +2 -3
index 5c44d3b77b3e..179584d10109 100644
@@ -216,8 +216,7 @@ static struct regmap_irq_chip bd70528_irq_chip = {
 	.irq_reg_stride = 1,
 };
 
-static int bd70528_i2c_probe(struct i2c_client *i2c,
-			     const struct i2c_device_id *id)
+static int bd70528_i2c_probe(struct i2c_client *i2c)
 {
 	struct bd70528_data *bd70528;
 	struct regmap_irq_chip_data *irq_data;
@@ -304,7 +303,7 @@ static struct i2c_driver bd70528_drv = {
 		.name = "rohm-bd70528",
 		.of_match_table = bd70528_of_match,
 	},
-	.probe = &bd70528_i2c_probe,
+	.probe_new = &bd70528_i2c_probe,
 };
 
 module_i2c_driver(bd70528_drv);
drivers/mfd/rohm-bd718x7.c +2 -3
index c32c1b6c98fa..e621e1a82222 100644
@@ -129,8 +129,7 @@ static int bd718xx_init_press_duration(struct bd718xx *bd718xx)
 	return 0;
 }
 
-static int bd718xx_i2c_probe(struct i2c_client *i2c,
-			    const struct i2c_device_id *id)
+static int bd718xx_i2c_probe(struct i2c_client *i2c)
 {
 	struct bd718xx *bd718xx;
 	int ret;
@@ -226,7 +225,7 @@ static struct i2c_driver bd718xx_i2c_driver = {
 		.name = "rohm-bd718x7",
 		.of_match_table = bd718xx_of_match,
 	},
-	.probe = bd718xx_i2c_probe,
+	.probe_new = bd718xx_i2c_probe,
 };
 
 static int __init bd718xx_i2c_init(void)

base-commit: 16fbf79b0f83bc752cee8589279f1ebfe57b3b6e

Signature · 14 lines
2.21.0


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 
#1 lore raw
Quoted 3 lines · Matti Vaittinen

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

Not sure I understand the purpose of the patch.

The only reason to switch to probe_new is to aid the removal of the compulsory I2C tables. However, neither of these drivers have them.

Quoted 5 lines
---
 drivers/mfd/rohm-bd70528.c | 5 ++---
 drivers/mfd/rohm-bd718x7.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

Hello Lee,

Quoted 10 lines · Lee Jones
Quoted 3 lines · Matti Vaittinen

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

Not sure I understand the purpose of the patch.

The only reason to switch to probe_new is to aid the removal of the compulsory I2C tables. However, neither of these drivers have them.

Maybe I have misunderstood the probe_new. My understanding was that the probe_new is what should become the standard - Eg. eventually all I2C drivers would use probe which is not getting the ID tables as argument
- and the old probe could be removed. Thus I thought conversion of probe to probe_new would be required in order to get rid of the old probe. I think I got this understanding when I submitted driver for BD71828 - and I think it was you who suggested me to switch to probe_new as 'id' was unused. But if please just drop this patch if this change is not needed!

Thanks for taking a look at this :)

Best Regards

    --Matti
Quoted 6 lines
Quoted 6 lines
---
 drivers/mfd/rohm-bd70528.c | 5 ++---
 drivers/mfd/rohm-bd718x7.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
#3 lore raw
Quoted 14 lines · Matti

Hello Lee,

Quoted 10 lines · Lee Jones
Quoted 3 lines · Matti Vaittinen

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

Not sure I understand the purpose of the patch.

The only reason to switch to probe_new is to aid the removal of the compulsory I2C tables. However, neither of these drivers have them.

Quoted 9 lines

Maybe I have misunderstood the probe_new. My understanding was that the probe_new is what should become the standard - Eg. eventually all I2C drivers would use probe which is not getting the ID tables as argument
- and the old probe could be removed. Thus I thought conversion of probe to probe_new would be required in order to get rid of the old probe. I think I got this understanding when I submitted driver for BD71828 - and I think it was you who suggested me to switch to probe_new as 'id' was unused. But if please just drop this patch if this change is not needed!

Some I2C drivers do make use of 'id' though. So the standard probe will probably never go away. I wrote probe_new for drivers that wished to omit the I2C table. A better use of your time would be to go through the original probe users and figure out which I2C tables can be removed.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
Quoted 30 lines · Lee Jones
Quoted 16 lines · Matti

Hello Lee,

Quoted 6 lines · Lee Jones
Quoted 3 lines · Matti Vaittinen

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

Quoted 6 lines

Not sure I understand the purpose of the patch.

The only reason to switch to probe_new is to aid the removal of the
compulsory I2C tables. However, neither of these drivers have them.

Quoted 12 lines

Maybe I have misunderstood the probe_new. My understanding was that the
probe_new is what should become the standard - Eg. eventually all I2C
drivers would use probe which is not getting the ID tables as argument
- and the old probe could be removed. Thus I thought conversion of probe to probe_new would be required in order to get rid of the old probe. I think I got this understanding when I submitted driver for BD71828 - and I think it was you who suggested me to switch to probe_new as 'id' was unused. But if please just drop this patch if this change is not needed!

Quoted 5 lines

Some I2C drivers do make use of 'id' though. So the standard probe will probably never go away. I wrote probe_new for drivers that wished to omit the I2C table. A better use of your time would be to go through the original probe users and figure out which I2C tables can be removed.

Right. Unfortunately I don't have problems with excessive amounts of free time xD I did this probe-conversion for bd718x7 because that driver is originally written by me - and I try to contribute on maintenance of stuff I have pushed on your and other maintainer's shoulders :)

And as I said - if the usage of probe is just as fine as usage of probe_new - then please just drop this patch :)

Thanks for clarifying this!

Best Regards
Matti

#5 lore raw
Quoted 38 lines · Matti
Quoted 30 lines · Lee Jones
Quoted 16 lines · Matti

Hello Lee,

Quoted 6 lines · Lee Jones
Quoted 3 lines · Matti Vaittinen

ROHM BD70528 and BD718x7 drivers do not utilize the I2C id. Do the trivial conversion and make them to use probe_new instead of probe.

Quoted 6 lines

Not sure I understand the purpose of the patch.

The only reason to switch to probe_new is to aid the removal of the
compulsory I2C tables. However, neither of these drivers have them.

Quoted 12 lines

Maybe I have misunderstood the probe_new. My understanding was that the
probe_new is what should become the standard - Eg. eventually all I2C
drivers would use probe which is not getting the ID tables as argument
- and the old probe could be removed. Thus I thought conversion of probe to probe_new would be required in order to get rid of the old probe. I think I got this understanding when I submitted driver for BD71828 - and I think it was you who suggested me to switch to probe_new as 'id' was unused. But if please just drop this patch if this change is not needed!

Quoted 5 lines

Some I2C drivers do make use of 'id' though. So the standard probe will probably never go away. I wrote probe_new for drivers that wished to omit the I2C table. A better use of your time would be to go through the original probe users and figure out which I2C tables can be removed.

Quoted 8 lines

Right. Unfortunately I don't have problems with excessive amounts of free time xD I did this probe-conversion for bd718x7 because that driver is originally written by me - and I try to contribute on maintenance of stuff I have pushed on your and other maintainer's shoulders :)

And as I said - if the usage of probe is just as fine as usage of probe_new - then please just drop this patch :)

I should revisit the I2C situation at one point. It does seem silly to have a 4 year old *new* API.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog