]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-subdev: add release() internal op
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:37:42 +0000 (08:37 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:24:28 +0000 (13:24 -0400)
commit0a086d6ec136c30feb9d237369c5c1d84b521f25
tree803de4b1d91f85ebe8ab9153bdad7a26f7a1c1b4
parentc4f2299afdb0bbd1e875745735cedf85b1708007
media: v4l2-subdev: add release() internal op

If the subdevice created a device node, then the v4l2_subdev cannot
be freed until the last user of the device node closes it.

This means that we need a release() callback in v4l2_subdev_internal_ops
that is called from the video_device release function so the subdevice
driver can postpone freeing memory until the that callback is called.

If no video device node was created then the release callback can
be called immediately when the subdev is unregistered.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-device.c
include/media/v4l2-subdev.h