media: rpivid: Avoid returning EINVAL to a G_FMT ioctl
authorJohn Cox <jc@kynesim.co.uk>
Wed, 1 Sep 2021 15:34:50 +0000 (16:34 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Wed, 22 Sep 2021 14:32:17 +0000 (15:32 +0100)
commita5d2df01fe25d6fce11485c4d8ae0c0a1ddef43a
tree8655a295b0ef4f2f87fa0dc67a9ad1d35cbb622f
parent3e1698ed5013c1054e3dbf8a9fcd3a8549a95ece
media: rpivid: Avoid returning EINVAL to a G_FMT ioctl

V4L2 spec says that G/S/TRY_FMT IOCTLs should never return errors for
anything other than wrong buffer types. Improve the capture format
function such that this is so and unsupported values get converted
to supported ones properly.

Signed-off-by: John Cox <jc@kynesim.co.uk>
drivers/staging/media/rpivid/rpivid.c
drivers/staging/media/rpivid/rpivid.h
drivers/staging/media/rpivid/rpivid_video.c
drivers/staging/media/rpivid/rpivid_video.h