aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-11-27 11:56:50 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:17:54 -0500
commiteac8ea536aded07004bde917f05a2329902c64b0 (patch)
treed083c2aee98e068e27ad4884dc905266709edfe8 /Documentation/video4linux
parenta3a9e287daa1f299e318161b790b1c5902b1d869 (diff)
V4L/DVB (13549): v4l: Add video_device_node_name function
Many drivers access the device number (video_device::v4l2_devnode::num) in order to print the video device node name. Add and use a helper function to retrieve the video_device node name. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r--Documentation/video4linux/v4l2-framework.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index b806edaf3e75..74d677c8b036 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -561,6 +561,8 @@ video_device helper functions
561 561
562There are a few useful helper functions: 562There are a few useful helper functions:
563 563
564- file/video_device private data
565
564You can set/get driver private data in the video_device struct using: 566You can set/get driver private data in the video_device struct using:
565 567
566void *video_get_drvdata(struct video_device *vdev); 568void *video_get_drvdata(struct video_device *vdev);
@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file);
575 577
576returns the video_device belonging to the file struct. 578returns the video_device belonging to the file struct.
577 579
578The final helper function combines video_get_drvdata with 580The video_drvdata function combines video_get_drvdata with video_devdata:
579video_devdata:
580 581
581void *video_drvdata(struct file *file); 582void *video_drvdata(struct file *file);
582 583
@@ -584,6 +585,17 @@ You can go from a video_device struct to the v4l2_device struct using:
584 585
585struct v4l2_device *v4l2_dev = vdev->v4l2_dev; 586struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
586 587
588- Device node name
589
590The video_device node kernel name can be retrieved using
591
592const char *video_device_node_name(struct video_device *vdev);
593
594The name is used as a hint by userspace tools such as udev. The function
595should be used where possible instead of accessing the video_device::num and
596video_device::minor fields.
597
598
587video buffer helper functions 599video buffer helper functions
588----------------------------- 600-----------------------------
589 601