media: uvcvideo: Refactor uvc_ctrl_set_handle()
authorRicardo Ribalda <ribalda@chromium.org>
Fri, 9 May 2025 18:24:13 +0000 (18:24 +0000)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 16 Jun 2025 06:43:23 +0000 (08:43 +0200)
commit0aa112e4a880ff809ecd3426d9c7c9e1f4ad3826
tree9d1b29ebdb0e15a018f79b5c25fa9df83ff9132a
parentcdf8f4c78ab0c2dc98dd5b017b0a31590c3e046d
media: uvcvideo: Refactor uvc_ctrl_set_handle()

Today uvc_ctrl_set_handle() covers two use-uses: setting the handle and
clearing the handle. The only common code between the two cases is the
lockdep_assert_held.

The code looks cleaner if we split these two usecases in two functions.

We also take this opportunity to use pending_async_ctrls from ctrl where
possible.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20250509-uvc-followup-v1-1-73bcde30d2b5@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/usb/uvc/uvc_ctrl.c