media: subdev: Add v4l2_subdev_call_state_try() macro
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 1 Jul 2022 13:15:58 +0000 (14:15 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 15 Jul 2022 14:21:11 +0000 (15:21 +0100)
commit982c0487185bd466059ff618f398a8d074ddb654
tree9977ce97937c1d730c417dc50499eb95a412db1a
parentdbae22e2008ee6a3acf2b7d989800eff80f0aa1f
media: subdev: Add v4l2_subdev_call_state_try() macro

Add a helper macro for the situations where a non-MC driver needs to
call a state-operation (operation which takes a subdev state as a
parameter) in try-context in another subdev.

The macro allocates a new subdev state for the called subdev and frees
the state afterwards.

An example use case is a media platform driver testing if a
v4l2_subdev_format would be accepted by a source subdev.

This should not be used in MC drivers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
include/media/v4l2-subdev.h