diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-01-17 02:09:31 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-01-17 02:19:40 -0500 |
commit | ec87da107d11521123beaa9f8e4869c6f54e8df8 (patch) | |
tree | 65852d4baf194e6ff4c2c26e4c301bda0e5464b1 | |
parent | d77651a227f8920dd7ec179b84e400cce844eeb3 (diff) |
Input: olpc_apsp - assign priv->dev earlier
The dev field needs to be set when serio_register_port() is called,
because the open callback may use it (in the error handling path).
Fixes: commit af518342effd ("Input: olpc_apsp - check FIFO status on open(), not probe()")
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/serio/olpc_apsp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index b36084710f69..bae08226e3d9 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c | |||
@@ -195,6 +195,8 @@ static int olpc_apsp_probe(struct platform_device *pdev) | |||
195 | if (!priv) | 195 | if (!priv) |
196 | return -ENOMEM; | 196 | return -ENOMEM; |
197 | 197 | ||
198 | priv->dev = &pdev->dev; | ||
199 | |||
198 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 200 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
199 | priv->base = devm_ioremap_resource(&pdev->dev, res); | 201 | priv->base = devm_ioremap_resource(&pdev->dev, res); |
200 | if (IS_ERR(priv->base)) { | 202 | if (IS_ERR(priv->base)) { |
@@ -248,7 +250,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) | |||
248 | goto err_irq; | 250 | goto err_irq; |
249 | } | 251 | } |
250 | 252 | ||
251 | priv->dev = &pdev->dev; | ||
252 | device_init_wakeup(priv->dev, 1); | 253 | device_init_wakeup(priv->dev, 1); |
253 | platform_set_drvdata(pdev, priv); | 254 | platform_set_drvdata(pdev, priv); |
254 | 255 | ||