Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350589
b: refs/heads/master
c: bdc56b4
h: refs/heads/master
i:
  350587: 0ed4f8e
v: v3
  • Loading branch information
Lee Jones committed Dec 11, 2012
1 parent 3729225 commit 608de99
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 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: 195c1c660c1868ac2024ad0ee3d5dce49bde4488
refs/heads/master: bdc56b44038e1472d24c9195337226b8d6f2961e
27 changes: 13 additions & 14 deletions trunk/drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@ static char *supply_interface[] = {
static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct abx500_bm_data *plat = pdev->dev.platform_data;
struct abx500_chargalg *di;
int ret = 0;

Expand All @@ -1814,21 +1815,19 @@ static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "%s no mem for ab8500_chargalg\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;
}
} else {
dev_err(&pdev->dev, "missing dt node for ab8500_chargalg\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");
}

/* get device struct */
Expand Down

0 comments on commit 608de99

Please sign in to comment.