summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx23885/cx23885-417.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-08-14 06:43:36 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-08 10:01:01 -0300
commitf1b6a735328b507810d2436891ee977fb8cd62d7 (patch)
treeb4cd086ba308e37c37e762d4f37de66e8fbb9ca6 /drivers/media/pci/cx23885/cx23885-417.c
parent4d63a25c4523b5d18e5307897d56aff785f43bf5 (diff)
[media] cx23885: Add busy checks before changing formats
Before you can change the standard or the capture format, make sure the various vb2_queues aren't in use since you cannot change the buffer size from underneath a a busy vb2_queue. Also make sure that the return code of cx23885_set_tvnorm is returned correctly, otherwise the -EBUSY will be lost. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/cx23885/cx23885-417.c')
-rw-r--r--drivers/media/pci/cx23885/cx23885-417.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index f1ef9017e2a7..6973055f0814 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1248,18 +1248,18 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{
struct cx23885_dev *dev = video_drvdata(file);
unsigned int i;
+ int ret;
for (i = 0; i < ARRAY_SIZE(cx23885_tvnorms); i++)
if (id & cx23885_tvnorms[i].id)
break;
if (i == ARRAY_SIZE(cx23885_tvnorms))
return -EINVAL;
- dev->encodernorm = cx23885_tvnorms[i];
-
- /* Have the drier core notify the subdevices */
- cx23885_set_tvnorm(dev, id);
- return 0;
+ ret = cx23885_set_tvnorm(dev, id);
+ if (!ret)
+ dev->encodernorm = cx23885_tvnorms[i];
+ return ret;
}
static int vidioc_enum_input(struct file *file, void *priv,