[media] soc_camera_platform: Remove redundant platform_set_drvdata()
Commit 0998d06310
(device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
[g.liakhovetski@gmx.de: further simplified return statement]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
721110b34c
commit
f253f18418
|
@ -137,7 +137,6 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
|
||||||
struct soc_camera_platform_priv *priv;
|
struct soc_camera_platform_priv *priv;
|
||||||
struct soc_camera_platform_info *p = pdev->dev.platform_data;
|
struct soc_camera_platform_info *p = pdev->dev.platform_data;
|
||||||
struct soc_camera_device *icd;
|
struct soc_camera_device *icd;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -165,15 +164,7 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
|
||||||
v4l2_set_subdevdata(&priv->subdev, p);
|
v4l2_set_subdevdata(&priv->subdev, p);
|
||||||
strncpy(priv->subdev.name, dev_name(&pdev->dev), V4L2_SUBDEV_NAME_SIZE);
|
strncpy(priv->subdev.name, dev_name(&pdev->dev), V4L2_SUBDEV_NAME_SIZE);
|
||||||
|
|
||||||
ret = v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
|
return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
|
||||||
if (ret)
|
|
||||||
goto evdrs;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
evdrs:
|
|
||||||
platform_set_drvdata(pdev, NULL);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int soc_camera_platform_remove(struct platform_device *pdev)
|
static int soc_camera_platform_remove(struct platform_device *pdev)
|
||||||
|
@ -183,7 +174,6 @@ static int soc_camera_platform_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
p->icd->control = NULL;
|
p->icd->control = NULL;
|
||||||
v4l2_device_unregister_subdev(&priv->subdev);
|
v4l2_device_unregister_subdev(&priv->subdev);
|
||||||
platform_set_drvdata(pdev, NULL);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue