summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorHans Verkuil2015-06-15 13:33:37 +0200
committerMauro Carvalho Chehab2015-08-11 14:52:16 +0200
commiteb01b1bca9ac7644f178384a594881f2b3433773 (patch)
tree0c94fa4a17176c88a924e8c07103f8cf8a33fee0 /drivers/media/platform
parent[media] soc_camera: fix enum_input (diff)
downloadkernel-qcow2-linux-eb01b1bca9ac7644f178384a594881f2b3433773.tar.gz
kernel-qcow2-linux-eb01b1bca9ac7644f178384a594881f2b3433773.tar.xz
kernel-qcow2-linux-eb01b1bca9ac7644f178384a594881f2b3433773.zip
[media] soc_camera: fix expbuf support
- For vb1 drivers just return -ENOTTY. - For vb2 drivers allow vb2_expbuf without there being a stream owner: the vb2_expbuf function will return the correct error message in that case. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index f24062ddd4cd..5f1e5a8cbab4 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -470,14 +470,13 @@ static int soc_camera_expbuf(struct file *file, void *priv,
struct soc_camera_device *icd = file->private_data;
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
- if (icd->streamer != file)
- return -EBUSY;
-
/* videobuf2 only */
if (ici->ops->init_videobuf)
- return -EINVAL;
- else
- return vb2_expbuf(&icd->vb2_vidq, p);
+ return -ENOTTY;
+
+ if (icd->streamer && icd->streamer != file)
+ return -EBUSY;
+ return vb2_expbuf(&icd->vb2_vidq, p);
}
/* Always entered with .host_lock held */