media: uvcvideo: refactor __uvc_ctrl_add_mapping
authorRicardo Ribalda <ribalda@chromium.org>
Fri, 18 Jun 2021 12:29:10 +0000 (14:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:36 +0000 (09:39 +0100)
commitc7121f186c1c87c3186ea8994e9f4b3a03651b1a
treed3cbec64e7db33507ed12f899262b56eb6749ff5
parentd9eacd945f1661dfcc3e8b42500cd56b8383b0fc
media: uvcvideo: refactor __uvc_ctrl_add_mapping

[ Upstream commit 866c6bdd5663d4df7cf384b381b6ef8ba9ffd0e4 ]

Pass the chain instead of the device. We want to keep the reference to
the chain that controls belong to.

We need to delay the initialization of the controls after the chains
have been initialized.

This is a cleanup needed for the next patches.

Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Stable-dep-of: 9f582f0418ed ("media: uvcvideo: Check for INACTIVE in uvc_ctrl_is_accessible()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c
drivers/media/usb/uvc/uvc_driver.c