usb: gadget: uvc: also use try_format in set_format
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Wed, 26 Oct 2022 18:22:40 +0000 (20:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Nov 2022 15:50:22 +0000 (16:50 +0100)
commit181babf7b4e5050b7a23cb47eb06277405cf132f
treea2eec39dc4c673941d678327a70e5c3582a2807d
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8
usb: gadget: uvc: also use try_format in set_format

Since e219a712bc06 (usb: gadget: uvc: add v4l2 try_format api call) the
try_format function is available. With this function includes checks for
valid configurations programmed in the configfs. We use this function to
ensure to return valid values on the set_format callback.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Fixes: e219a712bc06 ("usb: gadget: uvc: add v4l2 try_format api call")
Link: https://lore.kernel.org/r/20221026182240.363055-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/uvc_v4l2.c