Skip to contentSkip to conversation

mfd: lp87565: Convert to use devm_mfd_add_devices

PATCH Applied Axel Lin 3 participants 3 messages Jul 30, 2017 – Aug 8, 2017 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: lp87565: Convert to use devm_mfd_add_devices

This fixes missing mfd_remove_devices() call when unload the module.

---
 drivers/mfd/lp87565.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/mfd/lp87565.c +3 -4
index 340ad0c..32d2a07 100644
@@ -73,10 +73,9 @@ static int lp87565_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, lp87565);
 
-	ret = mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO, lp87565_cells,
-			      ARRAY_SIZE(lp87565_cells), NULL, 0, NULL);
-
-	return ret;
+	return devm_mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO,
+				    lp87565_cells, ARRAY_SIZE(lp87565_cells),
+				    NULL, 0, NULL);
 }
 
 static const struct i2c_device_id lp87565_id_table[] = {
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Axel Lin

This fixes missing mfd_remove_devices() call when unload the module.

Quoted 25 lines
---
 drivers/mfd/lp87565.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/mfd/lp87565.c +3 -4
index 340ad0c..32d2a07 100644
@@ -73,10 +73,9 @@ static int lp87565_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, lp87565);
 
-	ret = mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO, lp87565_cells,
-			      ARRAY_SIZE(lp87565_cells), NULL, 0, NULL);
-
-	return ret;
+	return devm_mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO,
+				    lp87565_cells, ARRAY_SIZE(lp87565_cells),
+				    NULL, 0, NULL);
 }
 
 static const struct i2c_device_id lp87565_id_table[] = {
Applied
#2 lore raw
In reply to Axel Lin
Quoted 6 lines · Axel Lin

This fixes missing mfd_remove_devices() call when unload the module.

---
 drivers/mfd/lp87565.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Applied, thanks.

Quoted 18 lines
drivers/mfd/lp87565.c +3 -4
index 340ad0c..32d2a07 100644
@@ -73,10 +73,9 @@ static int lp87565_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, lp87565);
 
-	ret = mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO, lp87565_cells,
-			      ARRAY_SIZE(lp87565_cells), NULL, 0, NULL);
-
-	return ret;
+	return devm_mfd_add_devices(lp87565->dev, PLATFORM_DEVID_AUTO,
+				    lp87565_cells, ARRAY_SIZE(lp87565_cells),
+				    NULL, 0, NULL);
 }
 
 static const struct i2c_device_id lp87565_id_table[] = {
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog