V4L/DVB (13646): sh_mobile_ceu_camera: do not mark host occupied, when adding a clien...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / media / video / sh_mobile_ceu_camera.c
index 3271944f261ca443af50baf1718f3a4f9b18f2ea..2a38e1d9061380e57d59ce838ff86e1c5031c045 100644 (file)
@@ -459,6 +459,7 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)
 {
        struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
        struct sh_mobile_ceu_dev *pcdev = ici->priv;
+       int ret;
 
        if (pcdev->icd)
                return -EBUSY;
@@ -469,9 +470,11 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)
 
        pm_runtime_get_sync(ici->v4l2_dev.dev);
 
-       pcdev->icd = icd;
+       ret = sh_mobile_ceu_soft_reset(pcdev);
+       if (!ret)
+               pcdev->icd = icd;
 
-       return sh_mobile_ceu_soft_reset(pcdev);
+       return ret;
 }
 
 /* Called with .video_lock held */