Skip to content

Commit

Permalink
Input: olpc_apsp - assign priv->dev earlier
Browse files Browse the repository at this point in the history
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 af51834 ("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>
  • Loading branch information
Lubomir Rintel authored and Dmitry Torokhov committed Jan 17, 2019
1 parent d77651a commit ec87da1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/serio/olpc_apsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;

priv->dev = &pdev->dev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->base)) {
Expand Down Expand Up @@ -248,7 +250,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
goto err_irq;
}

priv->dev = &pdev->dev;
device_init_wakeup(priv->dev, 1);
platform_set_drvdata(pdev, priv);

Expand Down

0 comments on commit ec87da1

Please sign in to comment.