2024-01-23 16:38:14

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 00/21] Power supply register with devm

Hello all,

This is a semi-automated series converting several drivers
under power/supply over to using devm_power_supply_register().
The more trivial cases are first, the last 3 drivers needed
a little pre-work to convert their IIO uses over to devm before
power_supply_register() could be switched.

Thanks,
Andrew

Andrew Davis (21):
power: supply: da9030: Use devm_power_supply_register() helper
power: supply: da9052: Use devm_power_supply_register() helper
power: supply: ds2760: Use devm_power_supply_register() helper
power: supply: goldfish: Use devm_power_supply_register() helper
power: supply: lp8727: Use devm_power_supply_register() helper
power: supply: lp8788: Use devm_power_supply_register() helper
power: supply: max14577: Use devm_power_supply_register() helper
power: supply: max77693: Use devm_power_supply_register() helper
power: supply: max8925: Use devm_power_supply_register() helper
power: supply: pcf50633: Use devm_power_supply_register() helper
power: supply: rt5033: Use devm_power_supply_register() helper
power: supply: tps65090: Use devm_power_supply_register() helper
power: supply: wm831x: Use devm_power_supply_register() helper
power: supply: wm831x: Use devm_power_supply_register() helper
power: supply: wm8350: Use devm_power_supply_register() helper
power: supply: da9150: Use devm_iio_channel_get() helper
power: supply: da9150: Use devm_power_supply_register() helper
power: supply: rx51: Use devm_iio_channel_get() helper
power: supply: rx51: Use devm_power_supply_register() helper
power: supply: twl4030_madc: Use devm_iio_channel_get() helper
power: supply: twl4030_madc: Use devm_power_supply_register() helper

drivers/power/supply/da9030_battery.c | 6 +-
drivers/power/supply/da9052-battery.c | 4 +-
drivers/power/supply/da9150-charger.c | 72 ++++++---------------
drivers/power/supply/ds2760_battery.c | 4 +-
drivers/power/supply/goldfish_battery.c | 24 ++-----
drivers/power/supply/lp8727_charger.c | 35 ++--------
drivers/power/supply/lp8788-charger.c | 21 ++----
drivers/power/supply/max14577_charger.c | 6 +-
drivers/power/supply/max77693_charger.c | 8 +--
drivers/power/supply/max8925_power.c | 36 +++--------
drivers/power/supply/pcf50633-charger.c | 23 +++----
drivers/power/supply/rt5033_battery.c | 14 +---
drivers/power/supply/rx51_battery.c | 57 ++++------------
drivers/power/supply/tps65090-charger.c | 18 ++----
drivers/power/supply/twl4030_madc_battery.c | 59 ++++-------------
drivers/power/supply/wm831x_backup.c | 13 +---
drivers/power/supply/wm831x_power.c | 24 +++----
drivers/power/supply/wm8350_power.c | 29 ++-------
18 files changed, 121 insertions(+), 332 deletions(-)

--
2.39.2



2024-01-23 16:38:20

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 03/21] power: supply: ds2760: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/ds2760_battery.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/supply/ds2760_battery.c b/drivers/power/supply/ds2760_battery.c
index 40fba31be1744..7cf4ea06b5003 100644
--- a/drivers/power/supply/ds2760_battery.c
+++ b/drivers/power/supply/ds2760_battery.c
@@ -739,7 +739,7 @@ static int w1_ds2760_add_slave(struct w1_slave *sl)
if (current_accum)
ds2760_battery_set_current_accum(di, current_accum);

- di->bat = power_supply_register(dev, &di->bat_desc, &psy_cfg);
+ di->bat = devm_power_supply_register(dev, &di->bat_desc, &psy_cfg);
if (IS_ERR(di->bat)) {
dev_err(di->dev, "failed to register battery\n");
retval = PTR_ERR(di->bat);
@@ -762,7 +762,6 @@ static int w1_ds2760_add_slave(struct w1_slave *sl)
goto success;

workqueue_failed:
- power_supply_unregister(di->bat);
batt_failed:
di_alloc_failed:
success:
@@ -777,7 +776,6 @@ static void w1_ds2760_remove_slave(struct w1_slave *sl)
cancel_delayed_work_sync(&di->monitor_work);
cancel_delayed_work_sync(&di->set_charged_work);
destroy_workqueue(di->monitor_wqueue);
- power_supply_unregister(di->bat);
}

#ifdef CONFIG_OF
--
2.39.2


2024-01-23 16:38:20

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 11/21] power: supply: rt5033: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/rt5033_battery.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
index d90b96df8e73d..32eafe2c00af5 100644
--- a/drivers/power/supply/rt5033_battery.c
+++ b/drivers/power/supply/rt5033_battery.c
@@ -159,12 +159,12 @@ static int rt5033_battery_probe(struct i2c_client *client)
return -EINVAL;
}

- i2c_set_clientdata(client, battery);
psy_cfg.of_node = client->dev.of_node;
psy_cfg.drv_data = battery;

- battery->psy = power_supply_register(&client->dev,
- &rt5033_battery_desc, &psy_cfg);
+ battery->psy = devm_power_supply_register(&client->dev,
+ &rt5033_battery_desc,
+ &psy_cfg);
if (IS_ERR(battery->psy))
return dev_err_probe(&client->dev, PTR_ERR(battery->psy),
"Failed to register power supply\n");
@@ -172,13 +172,6 @@ static int rt5033_battery_probe(struct i2c_client *client)
return 0;
}

-static void rt5033_battery_remove(struct i2c_client *client)
-{
- struct rt5033_battery *battery = i2c_get_clientdata(client);
-
- power_supply_unregister(battery->psy);
-}
-
static const struct i2c_device_id rt5033_battery_id[] = {
{ "rt5033-battery", },
{ }
@@ -197,7 +190,6 @@ static struct i2c_driver rt5033_battery_driver = {
.of_match_table = rt5033_battery_of_match,
},
.probe = rt5033_battery_probe,
- .remove = rt5033_battery_remove,
.id_table = rt5033_battery_id,
};
module_i2c_driver(rt5033_battery_driver);
--
2.39.2


2024-01-23 16:38:43

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 08/21] power: supply: max77693: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/max77693_charger.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/power/supply/max77693_charger.c b/drivers/power/supply/max77693_charger.c
index d0157e63b8b50..9ad6cc6500fcc 100644
--- a/drivers/power/supply/max77693_charger.c
+++ b/drivers/power/supply/max77693_charger.c
@@ -709,9 +709,9 @@ static int max77693_charger_probe(struct platform_device *pdev)
goto err;
}

- chg->charger = power_supply_register(&pdev->dev,
- &max77693_charger_desc,
- &psy_cfg);
+ chg->charger = devm_power_supply_register(&pdev->dev,
+ &max77693_charger_desc,
+ &psy_cfg);
if (IS_ERR(chg->charger)) {
dev_err(&pdev->dev, "failed: power supply register\n");
ret = PTR_ERR(chg->charger);
@@ -735,8 +735,6 @@ static void max77693_charger_remove(struct platform_device *pdev)
device_remove_file(&pdev->dev, &dev_attr_top_off_timer);
device_remove_file(&pdev->dev, &dev_attr_top_off_threshold_current);
device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer);
-
- power_supply_unregister(chg->charger);
}

static const struct platform_device_id max77693_charger_id[] = {
--
2.39.2


2024-01-23 16:38:55

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 10/21] power: supply: pcf50633: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/pcf50633-charger.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/power/supply/pcf50633-charger.c b/drivers/power/supply/pcf50633-charger.c
index 950e30917c638..0e980522fee51 100644
--- a/drivers/power/supply/pcf50633-charger.c
+++ b/drivers/power/supply/pcf50633-charger.c
@@ -404,9 +404,9 @@ static int pcf50633_mbc_probe(struct platform_device *pdev)
psy_cfg.drv_data = mbc;

/* Create power supplies */
- mbc->adapter = power_supply_register(&pdev->dev,
- &pcf50633_mbc_adapter_desc,
- &psy_cfg);
+ mbc->adapter = devm_power_supply_register(&pdev->dev,
+ &pcf50633_mbc_adapter_desc,
+ &psy_cfg);
if (IS_ERR(mbc->adapter)) {
dev_err(mbc->pcf->dev, "failed to register adapter\n");
return PTR_ERR(mbc->adapter);
@@ -415,20 +415,19 @@ static int pcf50633_mbc_probe(struct platform_device *pdev)
usb_psy_cfg = psy_cfg;
usb_psy_cfg.attr_grp = pcf50633_mbc_sysfs_groups;

- mbc->usb = power_supply_register(&pdev->dev, &pcf50633_mbc_usb_desc,
- &usb_psy_cfg);
+ mbc->usb = devm_power_supply_register(&pdev->dev,
+ &pcf50633_mbc_usb_desc,
+ &usb_psy_cfg);
if (IS_ERR(mbc->usb)) {
dev_err(mbc->pcf->dev, "failed to register usb\n");
- power_supply_unregister(mbc->adapter);
return PTR_ERR(mbc->usb);
}

- mbc->ac = power_supply_register(&pdev->dev, &pcf50633_mbc_ac_desc,
- &psy_cfg);
+ mbc->ac = devm_power_supply_register(&pdev->dev,
+ &pcf50633_mbc_ac_desc,
+ &psy_cfg);
if (IS_ERR(mbc->ac)) {
dev_err(mbc->pcf->dev, "failed to register ac\n");
- power_supply_unregister(mbc->adapter);
- power_supply_unregister(mbc->usb);
return PTR_ERR(mbc->ac);
}

@@ -449,10 +448,6 @@ static void pcf50633_mbc_remove(struct platform_device *pdev)
/* Remove IRQ handlers */
for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
-
- power_supply_unregister(mbc->usb);
- power_supply_unregister(mbc->adapter);
- power_supply_unregister(mbc->ac);
}

static struct platform_driver pcf50633_mbc_driver = {
--
2.39.2


2024-01-23 16:39:36

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 06/21] power: supply: lp8788: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/lp8788-charger.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
index 2c81be82a41a4..72b170b4ac46a 100644
--- a/drivers/power/supply/lp8788-charger.c
+++ b/drivers/power/supply/lp8788-charger.c
@@ -406,12 +406,6 @@ static const struct power_supply_desc lp8788_psy_battery_desc = {
.get_property = lp8788_battery_get_property,
};

-static void lp8788_psy_unregister(struct lp8788_charger *pchg)
-{
- power_supply_unregister(pchg->battery);
- power_supply_unregister(pchg->charger);
-}
-
static void lp8788_charger_event(struct work_struct *work)
{
struct lp8788_charger *pchg =
@@ -666,18 +660,16 @@ static int lp8788_psy_register(struct platform_device *pdev,
charger_cfg.supplied_to = battery_supplied_to;
charger_cfg.num_supplicants = ARRAY_SIZE(battery_supplied_to);

- pchg->charger = power_supply_register(&pdev->dev,
- &lp8788_psy_charger_desc,
- &charger_cfg);
+ pchg->charger = devm_power_supply_register(&pdev->dev,
+ &lp8788_psy_charger_desc,
+ &charger_cfg);
if (IS_ERR(pchg->charger))
return -EPERM;

- pchg->battery = power_supply_register(&pdev->dev,
- &lp8788_psy_battery_desc, NULL);
- if (IS_ERR(pchg->battery)) {
- power_supply_unregister(pchg->charger);
+ pchg->battery = devm_power_supply_register(&pdev->dev,
+ &lp8788_psy_battery_desc, NULL);
+ if (IS_ERR(pchg->battery))
return -EPERM;
- }

return 0;
}
@@ -720,7 +712,6 @@ static void lp8788_charger_remove(struct platform_device *pdev)

flush_work(&pchg->charger_work);
lp8788_irq_unregister(pdev, pchg);
- lp8788_psy_unregister(pchg);
}

static struct platform_driver lp8788_charger_driver = {
--
2.39.2


2024-01-23 16:39:39

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 14/21] power: supply: wm831x: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/wm831x_power.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/power/supply/wm831x_power.c b/drivers/power/supply/wm831x_power.c
index e49b01ee5f3ef..d56e499ac59fb 100644
--- a/drivers/power/supply/wm831x_power.c
+++ b/drivers/power/supply/wm831x_power.c
@@ -570,8 +570,9 @@ static int wm831x_power_probe(struct platform_device *pdev)
power->wall_desc.properties = wm831x_wall_props;
power->wall_desc.num_properties = ARRAY_SIZE(wm831x_wall_props);
power->wall_desc.get_property = wm831x_wall_get_prop;
- power->wall = power_supply_register(&pdev->dev, &power->wall_desc,
- NULL);
+ power->wall = devm_power_supply_register(&pdev->dev,
+ &power->wall_desc,
+ NULL);
if (IS_ERR(power->wall)) {
ret = PTR_ERR(power->wall);
goto err;
@@ -582,7 +583,9 @@ static int wm831x_power_probe(struct platform_device *pdev)
power->usb_desc.properties = wm831x_usb_props;
power->usb_desc.num_properties = ARRAY_SIZE(wm831x_usb_props);
power->usb_desc.get_property = wm831x_usb_get_prop;
- power->usb = power_supply_register(&pdev->dev, &power->usb_desc, NULL);
+ power->usb = devm_power_supply_register(&pdev->dev,
+ &power->usb_desc,
+ NULL);
if (IS_ERR(power->usb)) {
ret = PTR_ERR(power->usb);
goto err_wall;
@@ -599,9 +602,9 @@ static int wm831x_power_probe(struct platform_device *pdev)
power->battery_desc.num_properties = ARRAY_SIZE(wm831x_bat_props);
power->battery_desc.get_property = wm831x_bat_get_prop;
power->battery_desc.use_for_apm = 1;
- power->battery = power_supply_register(&pdev->dev,
- &power->battery_desc,
- NULL);
+ power->battery = devm_power_supply_register(&pdev->dev,
+ &power->battery_desc,
+ NULL);
if (IS_ERR(power->battery)) {
ret = PTR_ERR(power->battery);
goto err_usb;
@@ -684,12 +687,8 @@ static int wm831x_power_probe(struct platform_device *pdev)
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "SYSLO"));
free_irq(irq, power);
err_battery:
- if (power->have_battery)
- power_supply_unregister(power->battery);
err_usb:
- power_supply_unregister(power->usb);
err_wall:
- power_supply_unregister(power->wall);
err:
return ret;
}
@@ -717,11 +716,6 @@ static void wm831x_power_remove(struct platform_device *pdev)

irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "SYSLO"));
free_irq(irq, wm831x_power);
-
- if (wm831x_power->have_battery)
- power_supply_unregister(wm831x_power->battery);
- power_supply_unregister(wm831x_power->wall);
- power_supply_unregister(wm831x_power->usb);
}

static struct platform_driver wm831x_power_driver = {
--
2.39.2


2024-01-23 16:40:09

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 02/21] power: supply: da9052: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/da9052-battery.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/supply/da9052-battery.c b/drivers/power/supply/da9052-battery.c
index 6f7c58a41e918..0d84c42c624e0 100644
--- a/drivers/power/supply/da9052-battery.c
+++ b/drivers/power/supply/da9052-battery.c
@@ -622,7 +622,7 @@ static s32 da9052_bat_probe(struct platform_device *pdev)
}
}

- bat->psy = power_supply_register(&pdev->dev, &psy_desc, &psy_cfg);
+ bat->psy = devm_power_supply_register(&pdev->dev, &psy_desc, &psy_cfg);
if (IS_ERR(bat->psy)) {
ret = PTR_ERR(bat->psy);
goto err;
@@ -644,8 +644,6 @@ static void da9052_bat_remove(struct platform_device *pdev)

for (i = 0; i < ARRAY_SIZE(da9052_bat_irqs); i++)
da9052_free_irq(bat->da9052, da9052_bat_irq_bits[i], bat);
-
- power_supply_unregister(bat->psy);
}

static struct platform_driver da9052_bat_driver = {
--
2.39.2


2024-01-23 16:46:07

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 15/21] power: supply: wm8350: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/wm8350_power.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/drivers/power/supply/wm8350_power.c b/drivers/power/supply/wm8350_power.c
index f23b4f5343bc1..9b0010b28cafc 100644
--- a/drivers/power/supply/wm8350_power.c
+++ b/drivers/power/supply/wm8350_power.c
@@ -540,22 +540,17 @@ static int wm8350_power_probe(struct platform_device *pdev)
struct wm8350_charger_policy *policy = power->policy;
int ret;

- power->ac = power_supply_register(&pdev->dev, &wm8350_ac_desc, NULL);
+ power->ac = devm_power_supply_register(&pdev->dev, &wm8350_ac_desc, NULL);
if (IS_ERR(power->ac))
return PTR_ERR(power->ac);

- power->battery = power_supply_register(&pdev->dev, &wm8350_battery_desc,
- NULL);
- if (IS_ERR(power->battery)) {
- ret = PTR_ERR(power->battery);
- goto battery_failed;
- }
+ power->battery = devm_power_supply_register(&pdev->dev, &wm8350_battery_desc, NULL);
+ if (IS_ERR(power->battery))
+ return PTR_ERR(power->battery);

- power->usb = power_supply_register(&pdev->dev, &wm8350_usb_desc, NULL);
- if (IS_ERR(power->usb)) {
- ret = PTR_ERR(power->usb);
- goto usb_failed;
- }
+ power->usb = devm_power_supply_register(&pdev->dev, &wm8350_usb_desc, NULL);
+ if (IS_ERR(power->usb))
+ return PTR_ERR(power->usb);

ret = device_create_file(&pdev->dev, &dev_attr_charger_state);
if (ret < 0)
@@ -569,13 +564,6 @@ static int wm8350_power_probe(struct platform_device *pdev)
wm8350_reg_lock(wm8350);
}

- return ret;
-
-usb_failed:
- power_supply_unregister(power->battery);
-battery_failed:
- power_supply_unregister(power->ac);
-
return ret;
}

@@ -586,9 +574,6 @@ static void wm8350_power_remove(struct platform_device *pdev)

free_charger_irq(wm8350);
device_remove_file(&pdev->dev, &dev_attr_charger_state);
- power_supply_unregister(power->battery);
- power_supply_unregister(power->ac);
- power_supply_unregister(power->usb);
}

static struct platform_driver wm8350_power_driver = {
--
2.39.2


2024-01-23 16:46:41

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 21/21] power: supply: twl4030_madc: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/twl4030_madc_battery.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/power/supply/twl4030_madc_battery.c b/drivers/power/supply/twl4030_madc_battery.c
index cd9e94134ab21..3935162e350b5 100644
--- a/drivers/power/supply/twl4030_madc_battery.c
+++ b/drivers/power/supply/twl4030_madc_battery.c
@@ -215,30 +215,21 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
twl4030_cmp, NULL);

twl4030_madc_bat->pdata = pdata;
- platform_set_drvdata(pdev, twl4030_madc_bat);
psy_cfg.drv_data = twl4030_madc_bat;
- twl4030_madc_bat->psy = power_supply_register(&pdev->dev,
- &twl4030_madc_bat_desc,
- &psy_cfg);
+ twl4030_madc_bat->psy = devm_power_supply_register(&pdev->dev,
+ &twl4030_madc_bat_desc,
+ &psy_cfg);
if (IS_ERR(twl4030_madc_bat->psy))
return PTR_ERR(twl4030_madc_bat->psy);

return 0;
}

-static void twl4030_madc_battery_remove(struct platform_device *pdev)
-{
- struct twl4030_madc_battery *bat = platform_get_drvdata(pdev);
-
- power_supply_unregister(bat->psy);
-}
-
static struct platform_driver twl4030_madc_battery_driver = {
.driver = {
.name = "twl4030_madc_battery",
},
.probe = twl4030_madc_battery_probe,
- .remove_new = twl4030_madc_battery_remove,
};
module_platform_driver(twl4030_madc_battery_driver);

--
2.39.2


2024-01-23 16:49:00

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 17/21] power: supply: da9150: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/da9150-charger.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c
index 77e2d42382e45..b13cecd84f589 100644
--- a/drivers/power/supply/da9150-charger.c
+++ b/drivers/power/supply/da9150-charger.c
@@ -538,15 +538,13 @@ static int da9150_charger_probe(struct platform_device *pdev)
return PTR_ERR(charger->vbat_chan);

/* Register power supplies */
- charger->usb = power_supply_register(dev, &usb_desc, NULL);
+ charger->usb = devm_power_supply_register(dev, &usb_desc, NULL);
if (IS_ERR(charger->usb))
return PTR_ERR(charger->usb);

- charger->battery = power_supply_register(dev, &battery_desc, NULL);
- if (IS_ERR(charger->battery)) {
- ret = PTR_ERR(charger->battery);
- goto battery_fail;
- }
+ charger->battery = devm_power_supply_register(dev, &battery_desc, NULL);
+ if (IS_ERR(charger->battery))
+ return PTR_ERR(charger->battery);

/* Get initial online supply */
reg = da9150_reg_read(da9150, DA9150_STATUS_H);
@@ -606,8 +604,6 @@ static int da9150_charger_probe(struct platform_device *pdev)
chg_irq_fail:
if (!IS_ERR_OR_NULL(charger->usb_phy))
usb_unregister_notifier(charger->usb_phy, &charger->otg_nb);
-battery_fail:
- power_supply_unregister(charger->usb);

return ret;
}
@@ -633,9 +629,6 @@ static void da9150_charger_remove(struct platform_device *pdev)
if (!IS_ERR_OR_NULL(charger->usb_phy))
usb_unregister_notifier(charger->usb_phy, &charger->otg_nb);
cancel_work_sync(&charger->otg_work);
-
- power_supply_unregister(charger->battery);
- power_supply_unregister(charger->usb);
}

static struct platform_driver da9150_charger_driver = {
--
2.39.2


2024-01-23 16:49:14

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 13/21] power: supply: wm831x: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/wm831x_backup.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/power/supply/wm831x_backup.c b/drivers/power/supply/wm831x_backup.c
index 1a7265660adeb..9673fcf7f3afb 100644
--- a/drivers/power/supply/wm831x_backup.c
+++ b/drivers/power/supply/wm831x_backup.c
@@ -171,7 +171,6 @@ static int wm831x_backup_probe(struct platform_device *pdev)
return -ENOMEM;

devdata->wm831x = wm831x;
- platform_set_drvdata(pdev, devdata);

/* We ignore configuration failures since we can still read
* back the status without enabling the charger (which may
@@ -191,22 +190,14 @@ static int wm831x_backup_probe(struct platform_device *pdev)
devdata->backup_desc.properties = wm831x_backup_props;
devdata->backup_desc.num_properties = ARRAY_SIZE(wm831x_backup_props);
devdata->backup_desc.get_property = wm831x_backup_get_prop;
- devdata->backup = power_supply_register(&pdev->dev,
- &devdata->backup_desc, NULL);
+ devdata->backup = devm_power_supply_register(&pdev->dev,
+ &devdata->backup_desc, NULL);

return PTR_ERR_OR_ZERO(devdata->backup);
}

-static void wm831x_backup_remove(struct platform_device *pdev)
-{
- struct wm831x_backup *devdata = platform_get_drvdata(pdev);
-
- power_supply_unregister(devdata->backup);
-}
-
static struct platform_driver wm831x_backup_driver = {
.probe = wm831x_backup_probe,
- .remove_new = wm831x_backup_remove,
.driver = {
.name = "wm831x-backup",
},
--
2.39.2


2024-01-23 16:49:43

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 20/21] power: supply: twl4030_madc: Use devm_iio_channel_get() helper

Use the device lifecycle managed get function. This helps prevent
mistakes like releasing out of order in cleanup functions and
forgetting to release on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/twl4030_madc_battery.c | 44 ++++++---------------
1 file changed, 11 insertions(+), 33 deletions(-)

diff --git a/drivers/power/supply/twl4030_madc_battery.c b/drivers/power/supply/twl4030_madc_battery.c
index 33106476bea2c..cd9e94134ab21 100644
--- a/drivers/power/supply/twl4030_madc_battery.c
+++ b/drivers/power/supply/twl4030_madc_battery.c
@@ -188,30 +188,23 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
struct twl4030_madc_battery *twl4030_madc_bat;
struct twl4030_madc_bat_platform_data *pdata = pdev->dev.platform_data;
struct power_supply_config psy_cfg = {};
- int ret = 0;

twl4030_madc_bat = devm_kzalloc(&pdev->dev, sizeof(*twl4030_madc_bat),
GFP_KERNEL);
if (!twl4030_madc_bat)
return -ENOMEM;

- twl4030_madc_bat->channel_temp = iio_channel_get(&pdev->dev, "temp");
- if (IS_ERR(twl4030_madc_bat->channel_temp)) {
- ret = PTR_ERR(twl4030_madc_bat->channel_temp);
- goto err;
- }
+ twl4030_madc_bat->channel_temp = devm_iio_channel_get(&pdev->dev, "temp");
+ if (IS_ERR(twl4030_madc_bat->channel_temp))
+ return PTR_ERR(twl4030_madc_bat->channel_temp);

- twl4030_madc_bat->channel_ichg = iio_channel_get(&pdev->dev, "ichg");
- if (IS_ERR(twl4030_madc_bat->channel_ichg)) {
- ret = PTR_ERR(twl4030_madc_bat->channel_ichg);
- goto err_temp;
- }
+ twl4030_madc_bat->channel_ichg = devm_iio_channel_get(&pdev->dev, "ichg");
+ if (IS_ERR(twl4030_madc_bat->channel_ichg))
+ return PTR_ERR(twl4030_madc_bat->channel_ichg);

- twl4030_madc_bat->channel_vbat = iio_channel_get(&pdev->dev, "vbat");
- if (IS_ERR(twl4030_madc_bat->channel_vbat)) {
- ret = PTR_ERR(twl4030_madc_bat->channel_vbat);
- goto err_ichg;
- }
+ twl4030_madc_bat->channel_vbat = devm_iio_channel_get(&pdev->dev, "vbat");
+ if (IS_ERR(twl4030_madc_bat->channel_vbat))
+ return PTR_ERR(twl4030_madc_bat->channel_vbat);

/* sort charging and discharging calibration data */
sort(pdata->charging, pdata->charging_size,
@@ -227,21 +220,10 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
twl4030_madc_bat->psy = power_supply_register(&pdev->dev,
&twl4030_madc_bat_desc,
&psy_cfg);
- if (IS_ERR(twl4030_madc_bat->psy)) {
- ret = PTR_ERR(twl4030_madc_bat->psy);
- goto err_vbat;
- }
+ if (IS_ERR(twl4030_madc_bat->psy))
+ return PTR_ERR(twl4030_madc_bat->psy);

return 0;
-
-err_vbat:
- iio_channel_release(twl4030_madc_bat->channel_vbat);
-err_ichg:
- iio_channel_release(twl4030_madc_bat->channel_ichg);
-err_temp:
- iio_channel_release(twl4030_madc_bat->channel_temp);
-err:
- return ret;
}

static void twl4030_madc_battery_remove(struct platform_device *pdev)
@@ -249,10 +231,6 @@ static void twl4030_madc_battery_remove(struct platform_device *pdev)
struct twl4030_madc_battery *bat = platform_get_drvdata(pdev);

power_supply_unregister(bat->psy);
-
- iio_channel_release(bat->channel_vbat);
- iio_channel_release(bat->channel_ichg);
- iio_channel_release(bat->channel_temp);
}

static struct platform_driver twl4030_madc_battery_driver = {
--
2.39.2


2024-01-23 16:49:53

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 19/21] power: supply: rx51: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/rx51_battery.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/power/supply/rx51_battery.c b/drivers/power/supply/rx51_battery.c
index d532c670661b6..7cdcd415e8684 100644
--- a/drivers/power/supply/rx51_battery.c
+++ b/drivers/power/supply/rx51_battery.c
@@ -197,8 +197,6 @@ static int rx51_battery_probe(struct platform_device *pdev)
if (!di)
return -ENOMEM;

- platform_set_drvdata(pdev, di);
-
di->dev = &pdev->dev;
di->bat_desc.name = "rx51-battery";
di->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
@@ -220,20 +218,13 @@ static int rx51_battery_probe(struct platform_device *pdev)
if (IS_ERR(di->channel_vbat))
return PTR_ERR(di->channel_vbat);

- di->bat = power_supply_register(di->dev, &di->bat_desc, &psy_cfg);
+ di->bat = devm_power_supply_register(di->dev, &di->bat_desc, &psy_cfg);
if (IS_ERR(di->bat))
return PTR_ERR(di->bat);

return 0;
}

-static void rx51_battery_remove(struct platform_device *pdev)
-{
- struct rx51_device_info *di = platform_get_drvdata(pdev);
-
- power_supply_unregister(di->bat);
-}
-
#ifdef CONFIG_OF
static const struct of_device_id n900_battery_of_match[] = {
{.compatible = "nokia,n900-battery", },
@@ -244,7 +235,6 @@ MODULE_DEVICE_TABLE(of, n900_battery_of_match);

static struct platform_driver rx51_battery_driver = {
.probe = rx51_battery_probe,
- .remove_new = rx51_battery_remove,
.driver = {
.name = "rx51-battery",
.of_match_table = of_match_ptr(n900_battery_of_match),
--
2.39.2


2024-01-23 16:49:54

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 18/21] power: supply: rx51: Use devm_iio_channel_get() helper

Use the device lifecycle managed get function. This helps prevent
mistakes like releasing out of order in cleanup functions and
forgetting to release on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/rx51_battery.c | 45 +++++++----------------------
1 file changed, 11 insertions(+), 34 deletions(-)

diff --git a/drivers/power/supply/rx51_battery.c b/drivers/power/supply/rx51_battery.c
index e2bfc81f0fd97..d532c670661b6 100644
--- a/drivers/power/supply/rx51_battery.c
+++ b/drivers/power/supply/rx51_battery.c
@@ -192,7 +192,6 @@ static int rx51_battery_probe(struct platform_device *pdev)
{
struct power_supply_config psy_cfg = {};
struct rx51_device_info *di;
- int ret;

di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL);
if (!di)
@@ -209,41 +208,23 @@ static int rx51_battery_probe(struct platform_device *pdev)

psy_cfg.drv_data = di;

- di->channel_temp = iio_channel_get(di->dev, "temp");
- if (IS_ERR(di->channel_temp)) {
- ret = PTR_ERR(di->channel_temp);
- goto error;
- }
+ di->channel_temp = devm_iio_channel_get(di->dev, "temp");
+ if (IS_ERR(di->channel_temp))
+ return PTR_ERR(di->channel_temp);

- di->channel_bsi = iio_channel_get(di->dev, "bsi");
- if (IS_ERR(di->channel_bsi)) {
- ret = PTR_ERR(di->channel_bsi);
- goto error_channel_temp;
- }
+ di->channel_bsi = devm_iio_channel_get(di->dev, "bsi");
+ if (IS_ERR(di->channel_bsi))
+ return PTR_ERR(di->channel_bsi);

- di->channel_vbat = iio_channel_get(di->dev, "vbat");
- if (IS_ERR(di->channel_vbat)) {
- ret = PTR_ERR(di->channel_vbat);
- goto error_channel_bsi;
- }
+ di->channel_vbat = devm_iio_channel_get(di->dev, "vbat");
+ if (IS_ERR(di->channel_vbat))
+ return PTR_ERR(di->channel_vbat);

di->bat = power_supply_register(di->dev, &di->bat_desc, &psy_cfg);
- if (IS_ERR(di->bat)) {
- ret = PTR_ERR(di->bat);
- goto error_channel_vbat;
- }
+ if (IS_ERR(di->bat))
+ return PTR_ERR(di->bat);

return 0;
-
-error_channel_vbat:
- iio_channel_release(di->channel_vbat);
-error_channel_bsi:
- iio_channel_release(di->channel_bsi);
-error_channel_temp:
- iio_channel_release(di->channel_temp);
-error:
-
- return ret;
}

static void rx51_battery_remove(struct platform_device *pdev)
@@ -251,10 +232,6 @@ static void rx51_battery_remove(struct platform_device *pdev)
struct rx51_device_info *di = platform_get_drvdata(pdev);

power_supply_unregister(di->bat);
-
- iio_channel_release(di->channel_vbat);
- iio_channel_release(di->channel_bsi);
- iio_channel_release(di->channel_temp);
}

#ifdef CONFIG_OF
--
2.39.2


2024-01-23 17:03:21

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 04/21] power: supply: goldfish: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/goldfish_battery.c | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index 8bb645ad1e5d5..479195e35d734 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -232,31 +232,22 @@ static int goldfish_battery_probe(struct platform_device *pdev)

psy_cfg.drv_data = data;

- data->ac = power_supply_register(&pdev->dev, &ac_desc, &psy_cfg);
+ data->ac = devm_power_supply_register(&pdev->dev,
+ &ac_desc,
+ &psy_cfg);
if (IS_ERR(data->ac))
return PTR_ERR(data->ac);

- data->battery = power_supply_register(&pdev->dev, &battery_desc,
- &psy_cfg);
- if (IS_ERR(data->battery)) {
- power_supply_unregister(data->ac);
+ data->battery = devm_power_supply_register(&pdev->dev,
+ &battery_desc,
+ &psy_cfg);
+ if (IS_ERR(data->battery))
return PTR_ERR(data->battery);
- }
-
- platform_set_drvdata(pdev, data);

GOLDFISH_BATTERY_WRITE(data, BATTERY_INT_ENABLE, BATTERY_INT_MASK);
return 0;
}

-static void goldfish_battery_remove(struct platform_device *pdev)
-{
- struct goldfish_battery_data *data = platform_get_drvdata(pdev);
-
- power_supply_unregister(data->battery);
- power_supply_unregister(data->ac);
-}
-
static const struct of_device_id goldfish_battery_of_match[] = {
{ .compatible = "google,goldfish-battery", },
{},
@@ -273,7 +264,6 @@ MODULE_DEVICE_TABLE(acpi, goldfish_battery_acpi_match);

static struct platform_driver goldfish_battery_device = {
.probe = goldfish_battery_probe,
- .remove_new = goldfish_battery_remove,
.driver = {
.name = "goldfish-battery",
.of_match_table = goldfish_battery_of_match,
--
2.39.2


2024-01-23 17:06:44

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 09/21] power: supply: max8925: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/max8925_power.c | 36 ++++++++--------------------
1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/drivers/power/supply/max8925_power.c b/drivers/power/supply/max8925_power.c
index 4a2d6894f94ee..29ce6c5bfe0e6 100644
--- a/drivers/power/supply/max8925_power.c
+++ b/drivers/power/supply/max8925_power.c
@@ -528,25 +528,19 @@ static int max8925_power_probe(struct platform_device *pdev)
psy_cfg.supplied_to = pdata->supplied_to;
psy_cfg.num_supplicants = pdata->num_supplicants;

- info->ac = power_supply_register(&pdev->dev, &ac_desc, &psy_cfg);
- if (IS_ERR(info->ac)) {
- ret = PTR_ERR(info->ac);
- goto out;
- }
+ info->ac = devm_power_supply_register(&pdev->dev, &ac_desc, &psy_cfg);
+ if (IS_ERR(info->ac))
+ return PTR_ERR(info->ac);
info->ac->dev.parent = &pdev->dev;

- info->usb = power_supply_register(&pdev->dev, &usb_desc, &psy_cfg);
- if (IS_ERR(info->usb)) {
- ret = PTR_ERR(info->usb);
- goto out_unregister_ac;
- }
+ info->usb = devm_power_supply_register(&pdev->dev, &usb_desc, &psy_cfg);
+ if (IS_ERR(info->usb))
+ return PTR_ERR(info->usb);
info->usb->dev.parent = &pdev->dev;

- info->battery = power_supply_register(&pdev->dev, &battery_desc, NULL);
- if (IS_ERR(info->battery)) {
- ret = PTR_ERR(info->battery);
- goto out_unregister_usb;
- }
+ info->battery = devm_power_supply_register(&pdev->dev, &battery_desc, NULL);
+ if (IS_ERR(info->battery))
+ return PTR_ERR(info->battery);
info->battery->dev.parent = &pdev->dev;

info->batt_detect = pdata->batt_detect;
@@ -558,24 +552,14 @@ static int max8925_power_probe(struct platform_device *pdev)

max8925_init_charger(chip, info);
return 0;
-out_unregister_usb:
- power_supply_unregister(info->usb);
-out_unregister_ac:
- power_supply_unregister(info->ac);
-out:
- return ret;
}

static void max8925_power_remove(struct platform_device *pdev)
{
struct max8925_power_info *info = platform_get_drvdata(pdev);

- if (info) {
- power_supply_unregister(info->ac);
- power_supply_unregister(info->usb);
- power_supply_unregister(info->battery);
+ if (info)
max8925_deinit_charger(info);
- }
}

static struct platform_driver max8925_power_driver = {
--
2.39.2


2024-01-23 17:21:28

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 16/21] power: supply: da9150: Use devm_iio_channel_get() helper

Use the device lifecycle managed get function. This helps prevent
mistakes like releasing out of order in cleanup functions and
forgetting to release on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/da9150-charger.c | 57 +++++++--------------------
1 file changed, 14 insertions(+), 43 deletions(-)

diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c
index 37db9e4ed7f30..77e2d42382e45 100644
--- a/drivers/power/supply/da9150-charger.c
+++ b/drivers/power/supply/da9150-charger.c
@@ -521,36 +521,26 @@ static int da9150_charger_probe(struct platform_device *pdev)
charger->dev = dev;

/* Acquire ADC channels */
- charger->ibus_chan = iio_channel_get(dev, "CHAN_IBUS");
- if (IS_ERR(charger->ibus_chan)) {
- ret = PTR_ERR(charger->ibus_chan);
- goto ibus_chan_fail;
- }
+ charger->ibus_chan = devm_iio_channel_get(dev, "CHAN_IBUS");
+ if (IS_ERR(charger->ibus_chan))
+ return PTR_ERR(charger->ibus_chan);

- charger->vbus_chan = iio_channel_get(dev, "CHAN_VBUS");
- if (IS_ERR(charger->vbus_chan)) {
- ret = PTR_ERR(charger->vbus_chan);
- goto vbus_chan_fail;
- }
+ charger->vbus_chan = devm_iio_channel_get(dev, "CHAN_VBUS");
+ if (IS_ERR(charger->vbus_chan))
+ return PTR_ERR(charger->vbus_chan);

- charger->tjunc_chan = iio_channel_get(dev, "CHAN_TJUNC");
- if (IS_ERR(charger->tjunc_chan)) {
- ret = PTR_ERR(charger->tjunc_chan);
- goto tjunc_chan_fail;
- }
+ charger->tjunc_chan = devm_iio_channel_get(dev, "CHAN_TJUNC");
+ if (IS_ERR(charger->tjunc_chan))
+ return PTR_ERR(charger->tjunc_chan);

- charger->vbat_chan = iio_channel_get(dev, "CHAN_VBAT");
- if (IS_ERR(charger->vbat_chan)) {
- ret = PTR_ERR(charger->vbat_chan);
- goto vbat_chan_fail;
- }
+ charger->vbat_chan = devm_iio_channel_get(dev, "CHAN_VBAT");
+ if (IS_ERR(charger->vbat_chan))
+ return PTR_ERR(charger->vbat_chan);

/* Register power supplies */
charger->usb = power_supply_register(dev, &usb_desc, NULL);
- if (IS_ERR(charger->usb)) {
- ret = PTR_ERR(charger->usb);
- goto usb_fail;
- }
+ if (IS_ERR(charger->usb))
+ return PTR_ERR(charger->usb);

charger->battery = power_supply_register(dev, &battery_desc, NULL);
if (IS_ERR(charger->battery)) {
@@ -619,19 +609,6 @@ static int da9150_charger_probe(struct platform_device *pdev)
battery_fail:
power_supply_unregister(charger->usb);

-usb_fail:
- iio_channel_release(charger->vbat_chan);
-
-vbat_chan_fail:
- iio_channel_release(charger->tjunc_chan);
-
-tjunc_chan_fail:
- iio_channel_release(charger->vbus_chan);
-
-vbus_chan_fail:
- iio_channel_release(charger->ibus_chan);
-
-ibus_chan_fail:
return ret;
}

@@ -659,12 +636,6 @@ static void da9150_charger_remove(struct platform_device *pdev)

power_supply_unregister(charger->battery);
power_supply_unregister(charger->usb);
-
- /* Release ADC channels */
- iio_channel_release(charger->ibus_chan);
- iio_channel_release(charger->vbus_chan);
- iio_channel_release(charger->tjunc_chan);
- iio_channel_release(charger->vbat_chan);
}

static struct platform_driver da9150_charger_driver = {
--
2.39.2


2024-01-23 17:21:35

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 12/21] power: supply: tps65090: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/tps65090-charger.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c
index c59197d2aa87d..d41595764caa5 100644
--- a/drivers/power/supply/tps65090-charger.c
+++ b/drivers/power/supply/tps65090-charger.c
@@ -262,7 +262,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
psy_cfg.of_node = pdev->dev.of_node;
psy_cfg.drv_data = cdata;

- cdata->ac = power_supply_register(&pdev->dev, &tps65090_charger_desc,
+ cdata->ac = devm_power_supply_register(&pdev->dev, &tps65090_charger_desc,
&psy_cfg);
if (IS_ERR(cdata->ac)) {
dev_err(&pdev->dev, "failed: power supply register\n");
@@ -277,7 +277,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
ret = tps65090_config_charger(cdata);
if (ret < 0) {
dev_err(&pdev->dev, "charger config failed, err %d\n", ret);
- goto fail_unregister_supply;
+ return ret;
}

/* Check for charger presence */
@@ -286,14 +286,14 @@ static int tps65090_charger_probe(struct platform_device *pdev)
if (ret < 0) {
dev_err(cdata->dev, "%s(): Error in reading reg 0x%x", __func__,
TPS65090_REG_CG_STATUS1);
- goto fail_unregister_supply;
+ return ret;
}

if (status1 != 0) {
ret = tps65090_enable_charging(cdata);
if (ret < 0) {
dev_err(cdata->dev, "error enabling charger\n");
- goto fail_unregister_supply;
+ return ret;
}
cdata->ac_online = 1;
power_supply_changed(cdata->ac);
@@ -306,7 +306,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
dev_err(cdata->dev,
"Unable to register irq %d err %d\n", irq,
ret);
- goto fail_unregister_supply;
+ return ret;
}
} else {
cdata->poll_task = kthread_run(tps65090_charger_poll_task,
@@ -316,16 +316,11 @@ static int tps65090_charger_probe(struct platform_device *pdev)
ret = PTR_ERR(cdata->poll_task);
dev_err(cdata->dev,
"Unable to run kthread err %d\n", ret);
- goto fail_unregister_supply;
+ return ret;
}
}

return 0;
-
-fail_unregister_supply:
- power_supply_unregister(cdata->ac);
-
- return ret;
}

static void tps65090_charger_remove(struct platform_device *pdev)
@@ -334,7 +329,6 @@ static void tps65090_charger_remove(struct platform_device *pdev)

if (cdata->irq == -ENXIO)
kthread_stop(cdata->poll_task);
- power_supply_unregister(cdata->ac);
}

static const struct of_device_id of_tps65090_charger_match[] = {
--
2.39.2


2024-01-23 17:22:13

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 05/21] power: supply: lp8727: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/lp8727_charger.c | 35 ++++++---------------------
1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/drivers/power/supply/lp8727_charger.c b/drivers/power/supply/lp8727_charger.c
index 0875391f7ac6b..34548a4da90b2 100644
--- a/drivers/power/supply/lp8727_charger.c
+++ b/drivers/power/supply/lp8727_charger.c
@@ -453,39 +453,20 @@ static int lp8727_register_psy(struct lp8727_chg *pchg)
psy_cfg.supplied_to = battery_supplied_to;
psy_cfg.num_supplicants = ARRAY_SIZE(battery_supplied_to);

- psy->ac = power_supply_register(pchg->dev, &lp8727_ac_desc, &psy_cfg);
+ psy->ac = devm_power_supply_register(pchg->dev, &lp8727_ac_desc, &psy_cfg);
if (IS_ERR(psy->ac))
- goto err_psy_ac;
+ return -EPERM;

- psy->usb = power_supply_register(pchg->dev, &lp8727_usb_desc,
- &psy_cfg);
+ psy->usb = devm_power_supply_register(pchg->dev, &lp8727_usb_desc,
+ &psy_cfg);
if (IS_ERR(psy->usb))
- goto err_psy_usb;
+ return -EPERM;

- psy->batt = power_supply_register(pchg->dev, &lp8727_batt_desc, NULL);
+ psy->batt = devm_power_supply_register(pchg->dev, &lp8727_batt_desc, NULL);
if (IS_ERR(psy->batt))
- goto err_psy_batt;
+ return -EPERM;

return 0;
-
-err_psy_batt:
- power_supply_unregister(psy->usb);
-err_psy_usb:
- power_supply_unregister(psy->ac);
-err_psy_ac:
- return -EPERM;
-}
-
-static void lp8727_unregister_psy(struct lp8727_chg *pchg)
-{
- struct lp8727_psy *psy = pchg->psy;
-
- if (!psy)
- return;
-
- power_supply_unregister(psy->ac);
- power_supply_unregister(psy->usb);
- power_supply_unregister(psy->batt);
}

#ifdef CONFIG_OF
@@ -583,7 +564,6 @@ static int lp8727_probe(struct i2c_client *cl)
ret = lp8727_setup_irq(pchg);
if (ret) {
dev_err(pchg->dev, "irq handler err: %d", ret);
- lp8727_unregister_psy(pchg);
return ret;
}

@@ -595,7 +575,6 @@ static void lp8727_remove(struct i2c_client *cl)
struct lp8727_chg *pchg = i2c_get_clientdata(cl);

lp8727_release_irq(pchg);
- lp8727_unregister_psy(pchg);
}

static const struct of_device_id lp8727_dt_ids[] __maybe_unused = {
--
2.39.2


2024-01-23 17:22:20

by Andrew Davis

[permalink] [raw]
Subject: [PATCH 07/21] power: supply: max14577: Use devm_power_supply_register() helper

Use the device lifecycle managed register function. This helps prevent
mistakes like unregistering out of order in cleanup functions and
forgetting to unregister on error paths.

Signed-off-by: Andrew Davis <[email protected]>
---
drivers/power/supply/max14577_charger.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/max14577_charger.c b/drivers/power/supply/max14577_charger.c
index 7c23fa89ea199..1fff82b037097 100644
--- a/drivers/power/supply/max14577_charger.c
+++ b/drivers/power/supply/max14577_charger.c
@@ -586,8 +586,9 @@ static int max14577_charger_probe(struct platform_device *pdev)
}

psy_cfg.drv_data = chg;
- chg->charger = power_supply_register(&pdev->dev, &max14577_charger_desc,
- &psy_cfg);
+ chg->charger = devm_power_supply_register(&pdev->dev,
+ &max14577_charger_desc,
+ &psy_cfg);
if (IS_ERR(chg->charger)) {
dev_err(&pdev->dev, "failed: power supply register\n");
ret = PTR_ERR(chg->charger);
@@ -611,7 +612,6 @@ static void max14577_charger_remove(struct platform_device *pdev)
struct max14577_charger *chg = platform_get_drvdata(pdev);

device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer);
- power_supply_unregister(chg->charger);
}

static const struct platform_device_id max14577_charger_id[] = {
--
2.39.2


2024-01-26 12:07:25

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 08/21] power: supply: max77693: Use devm_power_supply_register() helper

Hi Andrew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-supply-da9030-Use-devm_power_supply_register-helper/20240124-004253
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link: https://lore.kernel.org/r/20240123163653.384385-9-afd%40ti.com
patch subject: [PATCH 08/21] power: supply: max77693: Use devm_power_supply_register() helper
config: i386-buildonly-randconfig-006-20240126 (https://download.01.org/0day-ci/archive/20240126/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/max77693_charger.c:733:27: warning: unused variable 'chg' [-Wunused-variable]
733 | struct max77693_charger *chg = platform_get_drvdata(pdev);
| ^~~
1 warning generated.


vim +/chg +733 drivers/power/supply/max77693_charger.c

87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 730
1d138270d2963b drivers/power/supply/max77693_charger.c Uwe Kleine-K?nig 2023-09-18 731 static void max77693_charger_remove(struct platform_device *pdev)
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 732 {
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 @733 struct max77693_charger *chg = platform_get_drvdata(pdev);
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 734
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 735 device_remove_file(&pdev->dev, &dev_attr_top_off_timer);
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 736 device_remove_file(&pdev->dev, &dev_attr_top_off_threshold_current);
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 737 device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer);
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 738 }
87c2d9067893cd drivers/power/max77693_charger.c Krzysztof Kozlowski 2015-01-20 739

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

2024-01-26 12:29:33

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 09/21] power: supply: max8925: Use devm_power_supply_register() helper

Hi Andrew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-supply-da9030-Use-devm_power_supply_register-helper/20240124-004253
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link: https://lore.kernel.org/r/20240123163653.384385-10-afd%40ti.com
patch subject: [PATCH 09/21] power: supply: max8925: Use devm_power_supply_register() helper
config: i386-buildonly-randconfig-001-20240126 (https://download.01.org/0day-ci/archive/20240126/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/max8925_power.c:510:6: warning: unused variable 'ret' [-Wunused-variable]
510 | int ret;
| ^~~
1 warning generated.


vim +/ret +510 drivers/power/supply/max8925_power.c

eba3b670a9166a drivers/power/max8925_power.c Qing Xu 2012-11-19 503
c8afa6406e60ae drivers/power/max8925_power.c Bill Pemberton 2012-11-19 504 static int max8925_power_probe(struct platform_device *pdev)
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 505 {
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 506 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 507 struct power_supply_config psy_cfg = {}; /* Only for ac and usb */
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 508 struct max8925_power_pdata *pdata = NULL;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 509 struct max8925_power_info *info;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 @510 int ret;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 511
eba3b670a9166a drivers/power/max8925_power.c Qing Xu 2012-11-19 512 pdata = max8925_power_dt_init(pdev);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 513 if (!pdata) {
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 514 dev_err(&pdev->dev, "platform data isn't assigned to "
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 515 "power supply\n");
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 516 return -EINVAL;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 517 }
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 518
feeb3a92b1f4e4 drivers/power/max8925_power.c Jingoo Han 2013-03-11 519 info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_power_info),
feeb3a92b1f4e4 drivers/power/max8925_power.c Jingoo Han 2013-03-11 520 GFP_KERNEL);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 521 if (!info)
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 522 return -ENOMEM;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 523 info->chip = chip;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 524 info->gpm = chip->i2c;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 525 info->adc = chip->adc;
2402ca5e300db0 drivers/power/max8925_power.c Haojian Zhuang 2011-04-18 526 platform_set_drvdata(pdev, info);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 527
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 528 psy_cfg.supplied_to = pdata->supplied_to;
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 529 psy_cfg.num_supplicants = pdata->num_supplicants;
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 530
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 531 info->ac = devm_power_supply_register(&pdev->dev, &ac_desc, &psy_cfg);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 532 if (IS_ERR(info->ac))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 533 return PTR_ERR(info->ac);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 534 info->ac->dev.parent = &pdev->dev;
e7a5f6d55991fb drivers/power/max8925_power.c Philip Rakity 2011-08-29 535
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 536 info->usb = devm_power_supply_register(&pdev->dev, &usb_desc, &psy_cfg);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 537 if (IS_ERR(info->usb))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 538 return PTR_ERR(info->usb);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 539 info->usb->dev.parent = &pdev->dev;
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 540
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 541 info->battery = devm_power_supply_register(&pdev->dev, &battery_desc, NULL);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 542 if (IS_ERR(info->battery))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 543 return PTR_ERR(info->battery);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 544 info->battery->dev.parent = &pdev->dev;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 545
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 546 info->batt_detect = pdata->batt_detect;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 547 info->topoff_threshold = pdata->topoff_threshold;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 548 info->fast_charge = pdata->fast_charge;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 549 info->set_charger = pdata->set_charger;
92de378b739115 drivers/power/max8925_power.c Philip Rakity 2011-11-25 550 info->no_temp_support = pdata->no_temp_support;
5ba1fa0ae288e9 drivers/power/max8925_power.c Philip Rakity 2011-11-25 551 info->no_insert_detect = pdata->no_insert_detect;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 552
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 553 max8925_init_charger(chip, info);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 554 return 0;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 555 }
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 556

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

2024-01-26 13:02:24

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 15/21] power: supply: wm8350: Use devm_power_supply_register() helper

Hi Andrew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-supply-da9030-Use-devm_power_supply_register-helper/20240124-004253
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link: https://lore.kernel.org/r/20240123163653.384385-16-afd%40ti.com
patch subject: [PATCH 15/21] power: supply: wm8350: Use devm_power_supply_register() helper
config: i386-buildonly-randconfig-004-20240126 (https://download.01.org/0day-ci/archive/20240126/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/wm8350_power.c:573:23: warning: unused variable 'power' [-Wunused-variable]
573 | struct wm8350_power *power = &wm8350->power;
| ^~~~~
1 warning generated.


vim +/power +573 drivers/power/supply/wm8350_power.c

14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 569
42720969f394dc drivers/power/supply/wm8350_power.c Uwe Kleine-K?nig 2023-09-18 570 static void wm8350_power_remove(struct platform_device *pdev)
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 571 {
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 572 struct wm8350 *wm8350 = platform_get_drvdata(pdev);
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 @573 struct wm8350_power *power = &wm8350->power;
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 574
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 575 free_charger_irq(wm8350);
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 576 device_remove_file(&pdev->dev, &dev_attr_charger_state);
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 577 }
14431aa0c5a443 drivers/power/wm8350_power.c Mark Brown 2008-11-16 578

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

2024-01-27 00:48:26

by Sebastian Reichel

[permalink] [raw]
Subject: Re: (subset) [PATCH 00/21] Power supply register with devm


On Tue, 23 Jan 2024 10:36:32 -0600, Andrew Davis wrote:
> This is a semi-automated series converting several drivers
> under power/supply over to using devm_power_supply_register().
> The more trivial cases are first, the last 3 drivers needed
> a little pre-work to convert their IIO uses over to devm before
> power_supply_register() could be switched.
>
> Thanks,
> Andrew
>
> [...]

Applied, thanks!

[01/21] power: supply: da9030: Use devm_power_supply_register() helper
commit: 98be59bd03aa50d155ba84208cd964017e397fc9
[02/21] power: supply: da9052: Use devm_power_supply_register() helper
commit: 57261cda154b3d0f8671ea222672f75b1e965c15
[03/21] power: supply: ds2760: Use devm_power_supply_register() helper
commit: 88a72257a438375894de446885bb40946e0f979f
[04/21] power: supply: goldfish: Use devm_power_supply_register() helper
commit: ada63f1ec91b77417cf195dadd646eaadb6f121c
[05/21] power: supply: lp8727: Use devm_power_supply_register() helper
commit: 3b4d07fdaf17a8bb79173c2c40876d3221edeea4
[06/21] power: supply: lp8788: Use devm_power_supply_register() helper
commit: 2abb571143c39f581df9951d263948726db42d86
[07/21] power: supply: max14577: Use devm_power_supply_register() helper
(no commit info)
[10/21] power: supply: pcf50633: Use devm_power_supply_register() helper
commit: e90a67f618c4a1128c49b11ddec37d9f1728ff5b
[11/21] power: supply: rt5033: Use devm_power_supply_register() helper
commit: 3a93da231c12bb153224bbbdd3d9a83da9e0ba33
[12/21] power: supply: tps65090: Use devm_power_supply_register() helper
commit: 503920abb586c3e355a19c680089ff5b33d97262
[13/21] power: supply: wm831x: Use devm_power_supply_register() helper
commit: f2a7667c6cc09431575a286ec87e823fddd4dd41
[14/21] power: supply: wm831x: Use devm_power_supply_register() helper
commit: f2a7667c6cc09431575a286ec87e823fddd4dd41
[16/21] power: supply: da9150: Use devm_iio_channel_get() helper
commit: 9115c677071a09cf51cace59c33ed71ec61bdfec
[17/21] power: supply: da9150: Use devm_power_supply_register() helper
commit: 077c1df8456f97d89e4880ba503d8ddf6af5be12
[18/21] power: supply: rx51: Use devm_iio_channel_get() helper
commit: a16dc57e97558dcff7c422b3abec4f9880e8272b
[19/21] power: supply: rx51: Use devm_power_supply_register() helper
commit: 4cb372a0ca220fff4a3878c4d1239af3e057e7cc
[20/21] power: supply: twl4030_madc: Use devm_iio_channel_get() helper
commit: 8ac675344280a406835f03746594345209f2c1ae
[21/21] power: supply: twl4030_madc: Use devm_power_supply_register() helper
commit: 4c5d387d79a65355b73e526cbf5754a9dcd5377b

Best regards,
--
Sebastian Reichel <[email protected]>