The patch number 9473 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]
------
From: Kay Sievers <[EMAIL PROTECTED]>
add DVB_DEVICE_NUM and DVB_ADAPTER_NUM to uevent
This allows udev to create proper device nodes without any
hacky shell scripts/programs to call, which guess these numbers
from the kernel device names.
Signed-off-by: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
linux/drivers/media/dvb/dvb-core/dvbdev.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff -r 76ded145bab1 -r 534445ecb653 linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c Fri Oct 24 09:13:23 2008 +0000
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c Tue Oct 28 01:27:37 2008 +0000
@@ -262,11 +262,11 @@ int dvb_register_device(struct dvb_adapt
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27)
clsdev = device_create(dvb_class, adap->device,
MKDEV(DVB_MAJOR, nums2minor(adap->num, type,
id)),
- NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
+ dvbdev, "dvb%d.%s%d", adap->num, dnames[type],
id);
#elif LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 27)
clsdev = device_create_drvdata(dvb_class, adap->device,
MKDEV(DVB_MAJOR, minor),
- NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
+ dvbdev, "dvb%d.%s%d", adap->num, dnames[type],
id);
#else
clsdev = device_create(dvb_class, adap->device,
MKDEV(DVB_MAJOR, minor),
@@ -451,6 +451,17 @@ out:
return err;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ struct dvb_device *dvbdev = dev_get_drvdata(dev);
+
+ add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id);
+ add_uevent_var(env, "DVB_ADAPTER_NUM=%d", dvbdev->adapter->num);
+ return 0;
+}
+#endif
+
static int __init init_dvbdev(void)
{
int retval;
@@ -477,6 +488,9 @@ static int __init init_dvbdev(void)
retval = PTR_ERR(dvb_class);
goto error;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
+ dvb_class->dev_uevent = dvb_uevent;
+#endif
return 0;
error:
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/534445ecb653f0624289a8a9f53b17fc9172e307
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits