summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2013-07-18 09:01:23 -0300
committerChanho Park <chanho61.park@samsung.com>2014-08-08 15:20:59 +0900
commite23a1623a8da977ad8cea53874f59f5478f17c7f (patch)
tree614b9f71c53833acf5fc8e7b9c5aeba841edb304
parentaa4389f99cb4695342ad8c718b5231bcd679ddb6 (diff)
downloadlinux-3.10-e23a1623a8da977ad8cea53874f59f5478f17c7f.tar.gz
linux-3.10-e23a1623a8da977ad8cea53874f59f5478f17c7f.tar.bz2
linux-3.10-e23a1623a8da977ad8cea53874f59f5478f17c7f.zip
upstream: [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 <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/stk1160/stk1160-v4l.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index ee46d82bed5..c45c9881bb5 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;