From: Guennadi Liakhovetski Date: Thu, 5 Aug 2010 22:23:44 +0000 (-0300) Subject: V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed X-Git-Tag: v3.0~3618^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=103754a0526fe35bddbcd8ccc913495c2a66ac21;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index f203293..a499cac 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;