[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>
This commit is contained in:
parent
d53c0f7275
commit
eb01b1bca9
1 changed files with 5 additions and 6 deletions
|
@ -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_device *icd = file->private_data;
|
||||||
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
|
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
|
||||||
|
|
||||||
if (icd->streamer != file)
|
|
||||||
return -EBUSY;
|
|
||||||
|
|
||||||
/* videobuf2 only */
|
/* videobuf2 only */
|
||||||
if (ici->ops->init_videobuf)
|
if (ici->ops->init_videobuf)
|
||||||
return -EINVAL;
|
return -ENOTTY;
|
||||||
else
|
|
||||||
return vb2_expbuf(&icd->vb2_vidq, p);
|
if (icd->streamer && icd->streamer != file)
|
||||||
|
return -EBUSY;
|
||||||
|
return vb2_expbuf(&icd->vb2_vidq, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always entered with .host_lock held */
|
/* Always entered with .host_lock held */
|
||||||
|
|
Loading…
Add table
Reference in a new issue