Commit 3f5c34c6 authored by Manuel Lauss's avatar Manuel Lauss Committed by Dmitry Torokhov

Input: wm97xx - make missing platform data non-fatal

Commit 6480af49 ("power_supply: wm97xx_battery: use
power_supply_get_drvdata") made wm97xx platform data mandatory, although
it's still optional.

This patch fixes an oops during driver probe on one of my MIPS boards with
a wm9712.
Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
Reviewed-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 62ed8ced
......@@ -682,7 +682,7 @@ static int wm97xx_probe(struct device *dev)
}
platform_set_drvdata(wm->battery_dev, wm);
wm->battery_dev->dev.parent = dev;
wm->battery_dev->dev.platform_data = pdata->batt_pdata;
wm->battery_dev->dev.platform_data = pdata ? pdata->batt_pdata : NULL;
ret = platform_device_add(wm->battery_dev);
if (ret < 0)
goto batt_reg_err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment