media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 24 Jan 2018 13:28:10 +0000 (08:28 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 30 Jan 2018 12:20:42 +0000 (07:20 -0500)
commitb2469c814fbc8f1f19676dd4912717b798df511e
tree3549c4c2b061c0405e1d4e9c33ec52104d9608d8
parent0fa2c5f954c41e870fe327907c01cb8f7ea8d5a2
media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt

Don't duplicate the buffer type checks in enum/g/s/try_fmt.
The check_fmt function does that already.

It is hard to keep the checks in sync for all these functions and
in fact the check for VBI was wrong in the _fmt functions as it
allowed SDR types as well. This caused a v4l2-compliance failure
for /dev/swradio0 using vivid.

This simplifies the code and keeps the check in one place and
fixes the SDR/VBI bug.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: <stable@vger.kernel.org> # for v4.15 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-ioctl.c