V4L/DVB (10291): em28xx: fix VIDIOC_G_CTRL when there is no msp34xx device.
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 21 Jan 2009 20:06:42 +0000 (17:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:26 +0000 (12:42 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-video.c

index 8e61b2ca9167810b3b8db9f6f7b982be41bd369e..d8b45b5ee041b6f78ed292c90aff8d2f7c277dae 100644 (file)
@@ -1008,8 +1008,13 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
 
        if (dev->board.has_msp34xx)
                em28xx_i2c_call_clients(dev, VIDIOC_G_CTRL, ctrl);
-       else
+       else {
                rc = em28xx_get_ctrl(dev, ctrl);
+               if (rc < 0) {
+                       em28xx_i2c_call_clients(dev, VIDIOC_G_CTRL, ctrl);
+                       rc = 0;
+               }
+       }
 
        mutex_unlock(&dev->lock);
        return rc;