V4L/DVB (10199): uvcvideo: Fix GET_DEF failure detection.
authorLaurent Pinchart <laurent.pinchart@skynet.be>
Sat, 3 Jan 2009 23:08:26 +0000 (20:08 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 29 Jan 2009 10:35:37 +0000 (08:35 -0200)
Commit 44f0079ec74330b457d990072c13cbe28b0f1abf erroneously considers all
GET_DEF requests as unsuccessful. Fix this by checking the request return
value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_video.c

index f9eb0e9740511b3a9cd5a6c397e013e96e59b478..9bc4705be78d8ebb893a9dd24d2e6215c344507f 100644 (file)
@@ -114,7 +114,7 @@ static int uvc_get_video_ctrl(struct uvc_video_device *video,
                ctrl->wCompQuality = le16_to_cpup((__le16 *)data);
                ret = 0;
                goto out;
-       } else if (query == GET_DEF && probe == 1) {
+       } else if (query == GET_DEF && probe == 1 && ret != size) {
                /* Many cameras don't support the GET_DEF request on their
                 * video probe control. Warn once and return, the caller will
                 * fall back to GET_CUR.