From: Ezequiel Garcia Date: Thu, 18 Jul 2013 12:01:23 +0000 (-0300) Subject: [media] media: stk1160: Ignore unchanged standard set X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b3ba8fa6b89bd99efe75080bfd8f3168781ae7de;p=openwrt%2Fstaging%2Fblogic.git [media] media: stk1160: Ignore unchanged standard set This commit adds an early check to vidioc_s_std() to detect if the new and current standards are equal, and exit with success in that case. This is needed to prevent userspace applications that might attempt to re-set the same standard from failing if that's done when streaming has started. Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index ee46d82bed5d..c45c9881bb5f 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c @@ -379,6 +379,9 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) struct stk1160 *dev = video_drvdata(file); struct vb2_queue *q = &dev->vb_vidq; + if (dev->norm == norm) + return 0; + if (vb2_is_busy(q)) return -EBUSY;