Skip to content

Commit

Permalink
Merge git://git.infradead.org/users/cbou/battery-2.6.33
Browse files Browse the repository at this point in the history
* git://git.infradead.org/users/cbou/battery-2.6.33:
  wm97xx_battery: Handle missing platform data gracefully
  • Loading branch information
torvalds committed Feb 11, 2010
2 parents fd48d6c + 12b336a commit 06a57f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/power/wm97xx_battery.c
Expand Up @@ -175,8 +175,14 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
dev_err(&dev->dev, "Do not pass platform_data through "
"wm97xx_bat_set_pdata!\n");
return -EINVAL;
} else
pdata = wmdata->batt_pdata;
}

if (!wmdata) {
dev_err(&dev->dev, "No platform data supplied\n");
return -EINVAL;
}

pdata = wmdata->batt_pdata;

if (dev->id != -1)
return -EINVAL;
Expand Down

0 comments on commit 06a57f4

Please sign in to comment.