diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-08-06 00:23:44 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-09 04:43:02 +0200 |
commit | 103754a0526fe35bddbcd8ccc913495c2a66ac21 (patch) | |
tree | 027bc6f68e52a7c0e68ad99ae39be0ca255821dd /drivers/media | |
parent | V4L/DVB: gspca - zc3xx: Redefine the exchanges of sensor mt9v111 (mi0360soc) (diff) | |
download | linux-103754a0526fe35bddbcd8ccc913495c2a66ac21.tar.xz linux-103754a0526fe35bddbcd8ccc913495c2a66ac21.zip |
V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed
There is no sense in trying to set cropping if we cannot get current one
from the host driver.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/soc_camera.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index f2032939fd4b..a499cacec1f3 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -779,9 +779,12 @@ static int soc_camera_s_crop(struct file *file, void *fh, ret = ici->ops->get_crop(icd, ¤t_crop); /* Prohibit window size change with initialised buffers */ - if (icf->vb_vidq.bufs[0] && !ret && - (a->c.width != current_crop.c.width || - a->c.height != current_crop.c.height)) { + if (ret < 0) { + dev_err(&icd->dev, + "S_CROP denied: getting current crop failed\n"); + } else if (icf->vb_vidq.bufs[0] && + (a->c.width != current_crop.c.width || + a->c.height != current_crop.c.height)) { dev_err(&icd->dev, "S_CROP denied: queue initialised and sizes differ\n"); ret = -EBUSY; |