summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 14:18:18 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 14:18:18 -0300
commit74c8a615523ef5d42b617ab521fa1c6a01da0cd9 (patch)
tree83a8f57d866a792f50e0447dccc5d1f4dd3d8b83 /linux/drivers/media/dvb/dvb-core
parent391254f7fc7cf4b47428973d700410f37b3f1a2e (diff)
downloadmediapointer-dvb-s2-74c8a615523ef5d42b617ab521fa1c6a01da0cd9.tar.gz
mediapointer-dvb-s2-74c8a615523ef5d42b617ab521fa1c6a01da0cd9.tar.bz2
backport commit 8a8bdcc7533b104d789d9bb3ed90da9352515e21
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: dvb: add nodename for dvb drivers This adds support to the dvb core to report the proper device name to userspace for their devices. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index f6084e19d..2028be23d 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -472,6 +472,17 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env)
}
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+static char *dvb_nodename(struct device *dev)
+{
+ struct dvb_device *dvbdev = dev_get_drvdata(dev);
+
+ return kasprintf(GFP_KERNEL, "dvb/adapter%d/%s%d",
+ dvbdev->adapter->num, dnames[dvbdev->type], dvbdev->id);
+}
+
+
+#endif
static int __init init_dvbdev(void)
{
int retval;
@@ -501,6 +512,9 @@ static int __init init_dvbdev(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
dvb_class->dev_uevent = dvb_uevent;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
+ dvb_class->nodename = dvb_nodename;
+#endif
return 0;
error: