]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] uvcvideo: Return -ENOTTY for unsupported ioctls
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 28 Aug 2012 21:38:58 +0000 (18:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 28 Nov 2012 12:28:37 +0000 (10:28 -0200)
The proper error code is -ENOTTY instead of -EINVAL.
This issue was found by the v4l2-compliance tool.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/uvc/uvc_v4l2.c

index b1aa55fb89840e99ba079a80cf84a1ff08c0d4a4..bf9d07393139c1e80ee314f41b59fa9e8f3d3fcf 100644 (file)
@@ -932,7 +932,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 
        case VIDIOC_G_CROP:
        case VIDIOC_S_CROP:
-               return -EINVAL;
+               return -ENOTTY;
 
        /* Buffers & streaming */
        case VIDIOC_REQBUFS:
@@ -1038,7 +1038,7 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 
        case VIDIOC_ENUMOUTPUT:
                uvc_trace(UVC_TRACE_IOCTL, "Unsupported ioctl 0x%08x\n", cmd);
-               return -EINVAL;
+               return -ENOTTY;
 
        case UVCIOC_CTRL_MAP:
                return uvc_ioctl_ctrl_map(chain, arg);