diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-13 23:22:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-13 11:08:53 -0800 |
commit | e015b50253610ffefca3b8f611e5ed4796a70c6c (patch) | |
tree | 4547f741fb62f8c8da2d4aea3cce8ae0afb81e5d /drivers | |
parent | 2781b86d7e45de09befa5ace296b66787146561f (diff) | |
download | linux-stable-e015b50253610ffefca3b8f611e5ed4796a70c6c.tar.gz linux-stable-e015b50253610ffefca3b8f611e5ed4796a70c6c.tar.bz2 linux-stable-e015b50253610ffefca3b8f611e5ed4796a70c6c.zip |
media: em28xx: use a default format if TRY_FMT fails
commit f823ce2a1202d47110a7ef86b65839f0be8adc38 upstream.
Follow the V4L2 spec, as warned by v4l2-compliance:
warn: v4l2-test-formats.cpp(732): TRY_FMT cannot handle an invalid pixelformat.
warn: v4l2-test-formats.cpp(733): This may or may not be a problem. For more information see:
warn: v4l2-test-formats.cpp(734): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
Cc: stable@vger.kernel.org
Fixes: bddcf63313c6 ("V4L/DVB (9927): em28xx: use a more standard way to specify video formats")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 68571bf36d28..f7c5110058e2 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1471,9 +1471,9 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, fmt = format_by_fourcc(f->fmt.pix.pixelformat); if (!fmt) { - em28xx_videodbg("Fourcc format (%08x) invalid.\n", - f->fmt.pix.pixelformat); - return -EINVAL; + fmt = &format[0]; + em28xx_videodbg("Fourcc format (%08x) invalid. Using default (%08x).\n", + f->fmt.pix.pixelformat, fmt->fourcc); } if (dev->board.is_em2800) { |