media: media-request: add media_request_object_find
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 21 May 2018 08:54:29 +0000 (04:54 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 15:07:08 +0000 (11:07 -0400)
commit0ca0e8442dcd5da2af5ce35e90b083a492b4cbac
treec26d8b7336aa27649e2a0470dcc1ec6921950ddd
parentbe9d6d4b0bf9cc3644826fb95264dbddb9a6d047
media: media-request: add media_request_object_find

Add media_request_object_find to find a request object inside a
request based on ops and priv values.

Objects of the same type (vb2 buffer, control handler) will have
the same ops value. And objects that refer to the same 'parent'
object (e.g. the v4l2_ctrl_handler that has the current driver
state) will have the same priv value.

The caller has to call media_request_object_put() for the returned
object since this function increments the refcount.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/media-request.c
include/media/media-request.h