diff mbox

media: stk1160: Ignore unchanged standard set

Message ID 1374152483-3106-1-git-send-email-ezequiel.garcia@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ezequiel Garcia July 18, 2013, 1:01 p.m. UTC
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>
---
Cc: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
Cc: Hans Verkuil <hans.verkuil@cisco.com>

 drivers/media/usb/stk1160/stk1160-v4l.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index ee46d82..c45c988 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;