Skip to contentSkip to conversation

input/wm97xx: make missing platform data non-fatal

PATCH RESEND In review Manuel Lauss 2 participants 2 messages Jan 19, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 input/wm97xx: make missing platform data non-fatal

Commit 6480af4915d6 ("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. Touchscreen continues to work fine, and I don't have any battery hooked up to it either, so I'm not missing any functionality.

---
Resend, added Maintainers to Cc.

 drivers/input/touchscreen/wm97xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/wm97xx-core.c +1 -1
index 83cf11312fd9..c9d1c91e1887 100644
@@ -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;
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Manuel Lauss

Commit 6480af4915d6 ("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. Touchscreen continues to work fine, and I don't have any battery hooked up to it either, so I'm not missing any functionality.

Quoted 5 lines

---

Thanks,
Charles