[media] media: davinci: vpbe: return error code on error in vpbe_display_g_crop()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 3 Dec 2012 01:50:47 +0000 (22:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 16:22:30 +0000 (14:22 -0200)
We have assigned error code to 'ret' if crop->type is not
V4L2_BUF_TYPE_VIDEO_OUTPUT, but never use it.
We'd better return the error code on this error.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Prabhakar Lad <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/davinci/vpbe_display.c

index 0723c4694cedc103d5c1bfb6ff5f0ce8ea86e2cf..d078738b35d63460b594e5d16b729eb3842ae276 100644 (file)
@@ -791,7 +791,6 @@ static int vpbe_display_g_crop(struct file *file, void *priv,
        struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
        struct osd_state *osd_device = fh->disp_dev->osd_device;
        struct v4l2_rect *rect = &crop->c;
-       int ret;
 
        v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
                        "VIDIOC_G_CROP, layer id = %d\n",
@@ -799,7 +798,7 @@ static int vpbe_display_g_crop(struct file *file, void *priv,
 
        if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
                v4l2_err(&vpbe_dev->v4l2_dev, "Invalid buf type\n");
-               ret = -EINVAL;
+               return -EINVAL;
        }
        osd_device->ops.get_layer_config(osd_device,
                                layer->layer_info.id, cfg);