The TRY_FMT call should try to avoid returning EINVAL. If the requested pixelformat is not supported by the driver, the driver should fall back to it's own default and only then fail the request. Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx> --- drivers/usb/gadget/function/uvc_v4l2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c index 3f728f451ed5..c5983bb0a8d1 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c @@ -317,11 +317,15 @@ uvc_v4l2_try_format(struct file *file, void *fh, struct v4l2_format *fmt) fmt->fmt.pix.width, fmt->fmt.pix.height); uformat = find_format_by_pix(uvc, fmt->fmt.pix.pixelformat); + if (!uformat) + uformat = get_default_format(uvc); if (!uformat) return -EINVAL; uframe = find_closest_frame_by_size(uvc, uformat, fmt->fmt.pix.width, fmt->fmt.pix.height); + if (!uframe) + uframe = get_default_frame(uvc, uformat); if (!uframe) return -EINVAL; -- 2.30.2