aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/ds2780_battery.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 18:15:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 18:15:24 -0400
commit151173e8ce9b95bbbbd7eedb9035cfaffbdb7cb2 (patch)
treebca02f40bdd054fa2e30f4923e1513d40873c4d9 /drivers/power/ds2780_battery.c
parent30945669593df14692e933c557d00c4bb2727857 (diff)
parent6b170807cd5cac8dc6353f47a88ccb14bbf76c4f (diff)
Merge tag 'for-v3.10' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov: "Highlights: - OpenFirmware/DeviceTree support for the Power Supply core: the core now automatically populates supplied_from hierarchy from the device tree. With these patches chargers and batteries can now lookup each other without the board files support shim. Rhyland Klein at NVIDIA did the work - New ST-Ericsson ABX500 hwmon driver. The driver is heavily using the AB85xx core and depends on some recent changes to it, so that is why the driver comes through the battery tree. It has an appropriate ack from the hwmon maintainer (i.e. Guenter Roeck). Martin Persson at ST-Ericsson and Hongbo Zhang at Linaro authored the driver - Final bits to sync AB85xx ST-Ericsson changes into mainline. The changes touch mfd parts, but these were acked by the appropriate MFD maintainer (ie Samuel Ortiz). Lee Jones at Linaro did most of the work and lead the submission process. Minor changes, but still worth mentioning: - Battery temperature reporting fix for Nokia N900 phones - Versatile Express poweroff driver moved into drivers/power/reset/ - Tree-wide: use devm_kzalloc() where appropriate - Tree-wide: dev_pm_ops cleanups/fixes" * tag 'for-v3.10' of git://git.infradead.org/battery-2.6: (112 commits) pm2301-charger: Fix suspend/resume charger-manager: Use kmemdup instead of kzalloc + memcpy power_supply: Populate supplied_from hierarchy from the device tree power_supply: Add core support for supplied_from power_supply: Define Binding for power-supplies rx51_battery: Fix reporting temperature hwmon: Add ST-Ericsson ABX500 hwmon driver ab8500_bmdata: Export abx500_res_to_temp tables for hwmon ab8500_{bmdata,fg}: Add const attributes to some data arrays ab8500_bmdata: Eliminate CamelCase warning of some variables ab8500_btemp: Make ab8500_btemp_get* interfaces public goldfish_battery: Use resource_size() lp8788-charger: Use PAGE_SIZE for the sysfs read operation max8925_power: Use devm_kzalloc() da9030_battery: Use devm_kzalloc() da9052-battery: Use devm_kzalloc() ds2760_battery: Use devm_kzalloc() ds2780_battery: Use devm_kzalloc() gpio-charger: Use devm_kzalloc() isp1704_charger: Use devm_kzalloc() ...
Diffstat (limited to 'drivers/power/ds2780_battery.c')
-rw-r--r--drivers/power/ds2780_battery.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/power/ds2780_battery.c b/drivers/power/ds2780_battery.c
index 8b6c4539e7f4..9f418fa879e5 100644
--- a/drivers/power/ds2780_battery.c
+++ b/drivers/power/ds2780_battery.c
@@ -760,7 +760,7 @@ static int ds2780_battery_probe(struct platform_device *pdev)
760 int ret = 0; 760 int ret = 0;
761 struct ds2780_device_info *dev_info; 761 struct ds2780_device_info *dev_info;
762 762
763 dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL); 763 dev_info = devm_kzalloc(&pdev->dev, sizeof(*dev_info), GFP_KERNEL);
764 if (!dev_info) { 764 if (!dev_info) {
765 ret = -ENOMEM; 765 ret = -ENOMEM;
766 goto fail; 766 goto fail;
@@ -779,7 +779,7 @@ static int ds2780_battery_probe(struct platform_device *pdev)
779 ret = power_supply_register(&pdev->dev, &dev_info->bat); 779 ret = power_supply_register(&pdev->dev, &dev_info->bat);
780 if (ret) { 780 if (ret) {
781 dev_err(dev_info->dev, "failed to register battery\n"); 781 dev_err(dev_info->dev, "failed to register battery\n");
782 goto fail_free_info; 782 goto fail;
783 } 783 }
784 784
785 ret = sysfs_create_group(&dev_info->bat.dev->kobj, &ds2780_attr_group); 785 ret = sysfs_create_group(&dev_info->bat.dev->kobj, &ds2780_attr_group);
@@ -813,8 +813,6 @@ fail_remove_group:
813 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2780_attr_group); 813 sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2780_attr_group);
814fail_unregister: 814fail_unregister:
815 power_supply_unregister(&dev_info->bat); 815 power_supply_unregister(&dev_info->bat);
816fail_free_info:
817 kfree(dev_info);
818fail: 816fail:
819 return ret; 817 return ret;
820} 818}
@@ -828,7 +826,6 @@ static int ds2780_battery_remove(struct platform_device *pdev)
828 826
829 power_supply_unregister(&dev_info->bat); 827 power_supply_unregister(&dev_info->bat);
830 828
831 kfree(dev_info);
832 return 0; 829 return 0;
833} 830}
834 831