]> 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)
commit5ffc7f5a61b4c715588d4b78bebdbaa0effea574
tree803de4b1d91f85ebe8ab9153bdad7a26f7a1c1b4
parent686a88e12c1148e6d0ab2f851f380e8341846baf
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