summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-11-27 13:56:50 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-16 00:17:54 -0200
commiteac8ea536aded07004bde917f05a2329902c64b0 (patch)
treed083c2aee98e068e27ad4884dc905266709edfe8 /include
parenta3a9e287daa1f299e318161b790b1c5902b1d869 (diff)
downloadlinux-eac8ea536aded07004bde917f05a2329902c64b0.tar.gz
linux-eac8ea536aded07004bde917f05a2329902c64b0.tar.bz2
linux-eac8ea536aded07004bde917f05a2329902c64b0.zip
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 'include')
-rw-r--r--include/media/v4l2-dev.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 73c9867d744c..9135f57351f6 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -141,6 +141,11 @@ static inline void *video_drvdata(struct file *file)
return video_get_drvdata(video_devdata(file));
}
+static inline const char *video_device_node_name(struct video_device *vdev)
+{
+ return dev_name(&vdev->dev);
+}
+
static inline int video_is_unregistered(struct video_device *vdev)
{
return test_bit(V4L2_FL_UNREGISTERED, &vdev->flags);