Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330478
b: refs/heads/master
c: 6297b5e
h: refs/heads/master
v: v3
  • Loading branch information
Devendra Naga authored and Anton Vorontsov committed Aug 23, 2012
1 parent ed4c6b3 commit ca67c03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: f77609959ade7378eed8b03df4c248f6d44c7e15
refs/heads/master: 6297b5e54b5511d4e72e8d5fc3b139650adc74d8
16 changes: 9 additions & 7 deletions trunk/drivers/power/lp8727_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static int lp8727_register_psy(struct lp8727_chg *pchg)

psy = kzalloc(sizeof(*psy), GFP_KERNEL);
if (!psy)
goto err_mem;
return -ENOMEM;

pchg->psy = psy;

Expand All @@ -375,7 +375,7 @@ static int lp8727_register_psy(struct lp8727_chg *pchg)
psy->ac.num_supplicants = ARRAY_SIZE(battery_supplied_to);

if (power_supply_register(pchg->dev, &psy->ac))
goto err_psy;
goto err_psy_ac;

psy->usb.name = "usb";
psy->usb.type = POWER_SUPPLY_TYPE_USB;
Expand All @@ -386,7 +386,7 @@ static int lp8727_register_psy(struct lp8727_chg *pchg)
psy->usb.num_supplicants = ARRAY_SIZE(battery_supplied_to);

if (power_supply_register(pchg->dev, &psy->usb))
goto err_psy;
goto err_psy_usb;

psy->batt.name = "main_batt";
psy->batt.type = POWER_SUPPLY_TYPE_BATTERY;
Expand All @@ -396,13 +396,15 @@ static int lp8727_register_psy(struct lp8727_chg *pchg)
psy->batt.external_power_changed = lp8727_charger_changed;

if (power_supply_register(pchg->dev, &psy->batt))
goto err_psy;
goto err_psy_batt;

return 0;

err_mem:
return -ENOMEM;
err_psy:
err_psy_batt:
power_supply_unregister(&psy->usb);
err_psy_usb:
power_supply_unregister(&psy->ac);
err_psy_ac:
kfree(psy);
return -EPERM;
}
Expand Down

0 comments on commit ca67c03

Please sign in to comment.