Home
last modified time | relevance | path

Searched hist:bedf8bcf6b4f90a6e31add3721a2e71877289381 (Results 1 – 1 of 1) sorted by relevance

/linux/include/media/
H A Dv4l2-device.hdiff bedf8bcf6b4f90a6e31add3721a2e71877289381 Sat Mar 12 10:37:19 CET 2011 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2-device: add kref and a release function

The video_device struct has proper ref counting and its release function
will be called when the last user releases it. But no such support was
available for struct v4l2_device. This made it hard to determine when a
USB driver can release the device if it has multiple device nodes.

With one device node it is easy of course, since when the device node is
released, the whole device can be released.

This patch adds refcounting to v4l2_device. When registering device nodes
the v4l2_device refcount will be increased, when releasing device nodes
it will be decreased. The (optional) release function will be called when
the last device node was released.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>