V4L/DVB (9931): em28xx: de-obfuscate vidioc_g_ctrl logic
vidioc_g_ctrl() were using an uneeded confusing logic. Instead, use the direct approach. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
@@ -1057,18 +1057,14 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
|
|||||||
rc = check_dev(dev);
|
rc = check_dev(dev);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
rc = 0;
|
||||||
|
|
||||||
mutex_lock(&dev->lock);
|
mutex_lock(&dev->lock);
|
||||||
|
|
||||||
if (!dev->board.has_msp34xx)
|
if (dev->board.has_msp34xx)
|
||||||
rc = em28xx_get_ctrl(dev, ctrl);
|
|
||||||
else
|
|
||||||
rc = -EINVAL;
|
|
||||||
|
|
||||||
if (rc == -EINVAL) {
|
|
||||||
em28xx_i2c_call_clients(dev, VIDIOC_G_CTRL, ctrl);
|
em28xx_i2c_call_clients(dev, VIDIOC_G_CTRL, ctrl);
|
||||||
rc = 0;
|
else
|
||||||
}
|
rc = em28xx_get_ctrl(dev, ctrl);
|
||||||
|
|
||||||
mutex_unlock(&dev->lock);
|
mutex_unlock(&dev->lock);
|
||||||
return rc;
|
return rc;
|
||||||
|
Reference in New Issue
Block a user