diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-11 22:06:15 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-11 22:06:15 (GMT) |
commit | 06a57f4f20d7bf7c3796abd541a7d400483a4596 (patch) | |
tree | 86f7c7436a21e6c558b8e12948afb76872d56cf4 /drivers | |
parent | fd48d6c888eb3eb3c7e94a8880c6121893bd17b8 (diff) | |
parent | 12b336a8b4ea8652372f88521bf55cef7f5d5283 (diff) | |
download | linux-fsl-qoriq-06a57f4f20d7bf7c3796abd541a7d400483a4596.tar.xz |
Merge git://git.infradead.org/users/cbou/battery-2.6.33
* git://git.infradead.org/users/cbou/battery-2.6.33:
wm97xx_battery: Handle missing platform data gracefully
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/wm97xx_battery.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c index fa39e75..6ea3cb5 100644 --- a/drivers/power/wm97xx_battery.c +++ b/drivers/power/wm97xx_battery.c @@ -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; |