aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pwc
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-25 04:53:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-05 11:54:47 -0500
commitf1927479554bf19d2ac54c4b1a38538e54e1881b (patch)
tree2b1d49db30c96a45397e2c698b95547216525c58 /drivers/media/usb/pwc
parent78f968fa26acbdf44457a7bc35a195b7df040b29 (diff)
[media] pwc: Don't return EINVAL when an unsupported pixelformat is requested
Instead chaneg the passed in format to the pwc default pixelformat. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/pwc')
-rw-r--r--drivers/media/usb/pwc/pwc-v4l.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/usb/pwc/pwc-v4l.c b/drivers/media/usb/pwc/pwc-v4l.c
index 545e9bbdeede..aa7449eaca08 100644
--- a/drivers/media/usb/pwc/pwc-v4l.c
+++ b/drivers/media/usb/pwc/pwc-v4l.c
@@ -434,19 +434,18 @@ static int pwc_vidioc_try_fmt(struct pwc_device *pdev, struct v4l2_format *f)
434 case V4L2_PIX_FMT_PWC1: 434 case V4L2_PIX_FMT_PWC1:
435 if (DEVICE_USE_CODEC23(pdev->type)) { 435 if (DEVICE_USE_CODEC23(pdev->type)) {
436 PWC_DEBUG_IOCTL("codec1 is only supported for old pwc webcam\n"); 436 PWC_DEBUG_IOCTL("codec1 is only supported for old pwc webcam\n");
437 return -EINVAL; 437 f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
438 } 438 }
439 break; 439 break;
440 case V4L2_PIX_FMT_PWC2: 440 case V4L2_PIX_FMT_PWC2:
441 if (DEVICE_USE_CODEC1(pdev->type)) { 441 if (DEVICE_USE_CODEC1(pdev->type)) {
442 PWC_DEBUG_IOCTL("codec23 is only supported for new pwc webcam\n"); 442 PWC_DEBUG_IOCTL("codec23 is only supported for new pwc webcam\n");
443 return -EINVAL; 443 f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
444 } 444 }
445 break; 445 break;
446 default: 446 default:
447 PWC_DEBUG_IOCTL("Unsupported pixel format\n"); 447 PWC_DEBUG_IOCTL("Unsupported pixel format\n");
448 return -EINVAL; 448 f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
449
450 } 449 }
451 450
452 size = pwc_get_size(pdev, f->fmt.pix.width, f->fmt.pix.height); 451 size = pwc_get_size(pdev, f->fmt.pix.width, f->fmt.pix.height);