Commit ec87da10 authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Dmitry Torokhov

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 af518342 ("Input: olpc_apsp - check FIFO status on open(), not probe()")
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d77651a2
...@@ -195,6 +195,8 @@ static int olpc_apsp_probe(struct platform_device *pdev) ...@@ -195,6 +195,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
priv->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(&pdev->dev, res); priv->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
...@@ -248,7 +250,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) ...@@ -248,7 +250,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
goto err_irq; goto err_irq;
} }
priv->dev = &pdev->dev;
device_init_wakeup(priv->dev, 1); device_init_wakeup(priv->dev, 1);
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
......
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