aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-02-24 04:28:46 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 15:38:06 -0400
commit2335e2b817186cf79a07311f14560ef8b30f6a9a (patch)
treec75b6d5f12c41734c01310409f7f26cfe65ee3dc /Documentation/video4linux
parentbedf8bcf6b4f90a6e31add3721a2e71877289381 (diff)
[media] v4l2-framework.txt: document new v4l2_device release() callback
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/v4l2-framework.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index 1c8d4492f5c7..7d09114af00b 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -181,6 +181,21 @@ static int __devinit drv_probe(struct pci_dev *pdev,
181 state->instance = atomic_inc_return(&drv_instance) - 1; 181 state->instance = atomic_inc_return(&drv_instance) - 1;
182} 182}
183 183
184If you have multiple device nodes then it can be difficult to know when it is
185safe to unregister v4l2_device. For this purpose v4l2_device has refcounting
186support. The refcount is increased whenever video_register_device is called and
187it is decreased whenever that device node is released. When the refcount reaches
188zero, then the v4l2_device release() callback is called. You can do your final
189cleanup there.
190
191If other device nodes (e.g. ALSA) are created, then you can increase and
192decrease the refcount manually as well by calling:
193
194void v4l2_device_get(struct v4l2_device *v4l2_dev);
195
196or:
197
198int v4l2_device_put(struct v4l2_device *v4l2_dev);
184 199
185struct v4l2_subdev 200struct v4l2_subdev
186------------------ 201------------------