Skip to content

Commit

Permalink
[media] pwc: Don't return EINVAL when an unsupported pixelformat is r…
Browse files Browse the repository at this point in the history
…equested

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>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Feb 5, 2013
1 parent 78f968f commit f192747
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/media/usb/pwc/pwc-v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f192747

Please sign in to comment.