Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350587
b: refs/heads/master
c: 7722b79
h: refs/heads/master
i:
  350585: a8c78c2
  350583: d2aa4a5
v: v3
  • Loading branch information
Lee Jones committed Dec 11, 2012
1 parent 9da0ed3 commit 0ed4f8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 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: 95820245edf93c9cd464004db8b52a4b690637a3
refs/heads/master: 7722b79964f0b1d7909eb7ef69632d73b07ca6a3
31 changes: 15 additions & 16 deletions trunk/drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,7 @@ static char *supply_interface[] = {
static int __devinit ab8500_charger_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct abx500_bm_data *plat = pdev->dev.platform_data;
struct ab8500_charger *di;
int irq, i, charger_status, ret = 0;

Expand All @@ -2644,24 +2645,22 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "%s no mem for ab8500_charger\n", __func__);
return -ENOMEM;
}
di->bm = pdev->mfd_cell->platform_data;
if (!di->bm) {
if (np) {
ret = ab8500_bm_of_probe(&pdev->dev, np, di->bm);
if (ret) {
dev_err(&pdev->dev,
"failed to get battery information\n");
return ret;
}
di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
} else {
dev_err(&pdev->dev, "missing dt node for ab8500_charger\n");
return -EINVAL;

if (!plat) {
dev_err(&pdev->dev, "no battery management data supplied\n");
return -EINVAL;
}
di->bm = plat;

if (np) {
ret = ab8500_bm_of_probe(&pdev->dev, np, di->bm);
if (ret) {
dev_err(&pdev->dev, "failed to get battery information\n");
return ret;
}
} else {
dev_info(&pdev->dev, "falling back to legacy platform data\n");
di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
} else
di->autopower_cfg = false;
}

/* get parent data */
di->dev = &pdev->dev;
Expand Down

0 comments on commit 0ed4f8e

Please sign in to comment.