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

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest, wolfson microelectronics drivers

STALE3482d

2 messages, 2 authors, 2017-01-19 · open the first message on its own page

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

From: Manuel Lauss <manuel.lauss@gmail.com>
Date: 2017-01-19 08:43:58

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.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: patches@opensource.wolfsonmicro.com
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
---
Resend, added Maintainers to Cc.

 drivers/input/touchscreen/wm97xx-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 83cf11312fd9..c9d1c91e1887 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -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;
-- 
2.11.0

Re: [PATCH RESEND] input/wm97xx: make missing platform data non-fatal

From: Charles Keepax <hidden>
Date: 2017-01-19 09:27:52

On Thu, Jan 19, 2017 at 09:43:53AM +0100, Manuel Lauss wrote:
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.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: patches@opensource.wolfsonmicro.com
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
---
Acked-by: Charles Keepax <redacted>

Thanks,
Charles
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help