Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242126
b: refs/heads/master
c: 2335e2b
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent 45f521f commit c9562fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bedf8bcf6b4f90a6e31add3721a2e71877289381
refs/heads/master: 2335e2b817186cf79a07311f14560ef8b30f6a9a
15 changes: 15 additions & 0 deletions trunk/Documentation/video4linux/v4l2-framework.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ static int __devinit drv_probe(struct pci_dev *pdev,
state->instance = atomic_inc_return(&drv_instance) - 1;
}

If you have multiple device nodes then it can be difficult to know when it is
safe to unregister v4l2_device. For this purpose v4l2_device has refcounting
support. The refcount is increased whenever video_register_device is called and
it is decreased whenever that device node is released. When the refcount reaches
zero, then the v4l2_device release() callback is called. You can do your final
cleanup there.

If other device nodes (e.g. ALSA) are created, then you can increase and
decrease the refcount manually as well by calling:

void v4l2_device_get(struct v4l2_device *v4l2_dev);

or:

int v4l2_device_put(struct v4l2_device *v4l2_dev);

struct v4l2_subdev
------------------
Expand Down

0 comments on commit c9562fb

Please sign in to comment.