[media] soc_camera_platform: Remove redundant platform_set_drvdata()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 13 May 2013 09:19:21 +0000 (06:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Jun 2013 16:11:00 +0000 (13:11 -0300)
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>
drivers/media/platform/soc_camera/soc_camera_platform.c

index 1b7a88ca195b9d6b2f016c7b4ce924f4a20e4a2a..bdf909d2ec35eac8eb13c366f07200e8f94357b3 100644 (file)
@@ -137,7 +137,6 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
        struct soc_camera_platform_priv *priv;
        struct soc_camera_platform_info *p = pdev->dev.platform_data;
        struct soc_camera_device *icd;
-       int ret;
 
        if (!p)
                return -EINVAL;
@@ -165,15 +164,7 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
        v4l2_set_subdevdata(&priv->subdev, p);
        strncpy(priv->subdev.name, dev_name(&pdev->dev), V4L2_SUBDEV_NAME_SIZE);
 
-       ret = v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
-       if (ret)
-               goto evdrs;
-
-       return ret;
-
-evdrs:
-       platform_set_drvdata(pdev, NULL);
-       return ret;
+       return v4l2_device_register_subdev(&ici->v4l2_dev, &priv->subdev);
 }
 
 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;
        v4l2_device_unregister_subdev(&priv->subdev);
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }