V4L/DVB (9931): em28xx: de-obfuscate vidioc_g_ctrl logic
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 22 Dec 2008 09:20:32 +0000 (06:20 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:39:22 +0000 (09:39 -0200)
vidioc_g_ctrl() were using an uneeded confusing logic. Instead, use the
direct approach.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-video.c

index fc41eead640bc6adc93a88890c02a831c1e0e081..4701b6589b10f914e01b1bf4dc3a577b853d3f22 100644 (file)
@@ -1057,18 +1057,14 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
        rc = check_dev(dev);
        if (rc < 0)
                return rc;
+       rc = 0;
 
        mutex_lock(&dev->lock);
 
-       if (!dev->board.has_msp34xx)
-               rc = em28xx_get_ctrl(dev, ctrl);
-       else
-               rc = -EINVAL;
-
-       if (rc == -EINVAL) {
+       if (dev->board.has_msp34xx)
                em28xx_i2c_call_clients(dev, VIDIOC_G_CTRL, ctrl);
-               rc = 0;
-       }
+       else
+               rc = em28xx_get_ctrl(dev, ctrl);
 
        mutex_unlock(&dev->lock);
        return rc;