Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330483
b: refs/heads/master
c: deacc4f
h: refs/heads/master
i:
  330481: adb6fb4
  330479: ae4ceb0
v: v3
  • Loading branch information
Devendra Naga authored and Anton Vorontsov committed Aug 23, 2012
1 parent 547f0b9 commit 14f46cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc6e51d8891629a9d117dc75a8a2eb9a411a3510
refs/heads/master: deacc4fe57794f80ad4449c7cea611921c2d0420
13 changes: 4 additions & 9 deletions trunk/drivers/power/ds2781_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,9 @@ static int __devinit ds2781_battery_probe(struct platform_device *pdev)
int ret = 0;
struct ds2781_device_info *dev_info;

dev_info = kzalloc(sizeof(*dev_info), GFP_KERNEL);
if (!dev_info) {
ret = -ENOMEM;
goto fail;
}
dev_info = devm_kzalloc(&pdev->dev, sizeof(*dev_info), GFP_KERNEL);
if (!dev_info)
return -ENOMEM;

platform_set_drvdata(pdev, dev_info);

Expand All @@ -774,7 +772,7 @@ static int __devinit ds2781_battery_probe(struct platform_device *pdev)
ret = power_supply_register(&pdev->dev, &dev_info->bat);
if (ret) {
dev_err(dev_info->dev, "failed to register battery\n");
goto fail_free_info;
goto fail;
}

ret = sysfs_create_group(&dev_info->bat.dev->kobj, &ds2781_attr_group);
Expand Down Expand Up @@ -808,8 +806,6 @@ static int __devinit ds2781_battery_probe(struct platform_device *pdev)
sysfs_remove_group(&dev_info->bat.dev->kobj, &ds2781_attr_group);
fail_unregister:
power_supply_unregister(&dev_info->bat);
fail_free_info:
kfree(dev_info);
fail:
return ret;
}
Expand All @@ -823,7 +819,6 @@ static int __devexit ds2781_battery_remove(struct platform_device *pdev)

power_supply_unregister(&dev_info->bat);

kfree(dev_info);
return 0;
}

Expand Down

0 comments on commit 14f46cb

Please sign in to comment.