summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 14:16:11 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 14:16:11 -0300
commit391254f7fc7cf4b47428973d700410f37b3f1a2e (patch)
tree079e4cc3993a7cf52d84120c7f8bacbaf3b3c26c /linux
parentea5644051e25a55f6a8a02e5c9d22e06dc318307 (diff)
downloadmediapointer-dvb-s2-391254f7fc7cf4b47428973d700410f37b3f1a2e.tar.gz
mediapointer-dvb-s2-391254f7fc7cf4b47428973d700410f37b3f1a2e.tar.bz2
backport changeset f7a386c5b8ff34cd84ae922603d1c6f9d234edee
From: Mauro Carvalho Chehab <mchehab@redhat.com> kernel-sync: Author: Kay Sievers <kay.sievers@vrfy.org> Date: Thu Apr 30 15:23:42 2009 +0200 Driver Core: usb: add nodename support for usb drivers. This adds support for USB drivers to report their requested nodename to userspace. It also updates a number of USB drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/dabusb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/drivers/media/video/dabusb.c b/linux/drivers/media/video/dabusb.c
index cb0a41c45..a0812ce91 100644
--- a/linux/drivers/media/video/dabusb.c
+++ b/linux/drivers/media/video/dabusb.c
@@ -813,8 +813,18 @@ static struct file_operations dabusb_fops =
.release = dabusb_release,
};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+static char *dabusb_nodename(struct device *dev)
+{
+ return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
+}
+
+#endif
static struct usb_class_driver dabusb_class = {
.name = "dabusb%d",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+ .nodename = dabusb_nodename,
+#endif
.fops = &dabusb_fops,
.minor_base = DABUSB_MINOR,
};