media: v4l: subdev: Add a function to lock two sub-device states, use it
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 6 Sep 2023 07:56:14 +0000 (10:56 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 29 Apr 2024 12:56:37 +0000 (14:56 +0200)
commit72364b91ce022ded4aa541c62f51c10a65fb3498
tree262064afa3318bf285b45f611c7b73e7c51c4530
parentcd2c75454d74f275adcda2409569c13fd037eca9
media: v4l: subdev: Add a function to lock two sub-device states, use it

Add two new functions, v4l2_subdev_lock_states() and
v4l2_subdev_unclock_states(), to acquire and release the state of two
sub-devices. They differ from calling v4l2_subdev_{un,}lock_state() so
that if the two states share the same lock, the lock is acquired only
once.

Also use the new functions in v4l2_subdev_link_validate().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h