diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-03-22 02:14:13 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-22 02:15:08 +0300 |
commit | 537c2e91d3549e5d6020bb0576cf9b54a845255f (patch) | |
tree | c09e8a1b7d733cde19b0c72678c28fb2bc97ff6b /drivers/power/supply/pcf50633-charger.c | |
parent | 237bb5f7f7f55ec5f773469a974c61a49c298625 (diff) | |
parent | cba9ffdb9913dfe6be29f049ce920ce451ce7cc4 (diff) | |
download | linux-537c2e91d3549e5d6020bb0576cf9b54a845255f.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/power/supply/pcf50633-charger.c')
-rw-r--r-- | drivers/power/supply/pcf50633-charger.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/power/supply/pcf50633-charger.c b/drivers/power/supply/pcf50633-charger.c index 950e30917c63..0e980522fee5 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 = { |