From: Hans de Goede Date: Fri, 25 Jan 2013 09:53:07 +0000 (-0300) Subject: [media] pwc: Don't return EINVAL when an unsupported pixelformat is requested X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f1927479554bf19d2ac54c4b1a38538e54e1881b;p=linux-beck.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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) case V4L2_PIX_FMT_PWC1: if (DEVICE_USE_CODEC23(pdev->type)) { PWC_DEBUG_IOCTL("codec1 is only supported for old pwc webcam\n"); - return -EINVAL; + f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420; } break; case V4L2_PIX_FMT_PWC2: if (DEVICE_USE_CODEC1(pdev->type)) { PWC_DEBUG_IOCTL("codec23 is only supported for new pwc webcam\n"); - return -EINVAL; + f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420; } break; default: PWC_DEBUG_IOCTL("Unsupported pixel format\n"); - return -EINVAL; - + f->fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420; } size = pwc_get_size(pdev, f->fmt.pix.width, f->fmt.pix.height);