]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
V4L/DVB: soc-camera: prohibit S_CROP, if internal G_CROP has failed
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Thu, 5 Aug 2010 22:23:44 +0000 (19:23 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Aug 2010 02:43:02 +0000 (23:43 -0300)
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>
drivers/media/video/soc_camera.c

index f2032939fd4b728d0d7465d03da5ec587087c52f..a499cacec1f37897c08de6d7bf21b1210723aca0 100644 (file)
@@ -779,9 +779,12 @@ static int soc_camera_s_crop(struct file *file, void *fh,
        ret = ici->ops->get_crop(icd, &current_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;