Andrew de Quincey wrote:
Hi, this is a patch which adds sysfs links back to the root adapter for DVB
devices. Example:
Currently in /sys/class/dvb/dvbX.demuxY/ we have:
dev
uevent
With the patch, we have (for a PCI DVB device):
dev
device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:03:0d.0
uevent
So userspace tools can (finally) work out which physical device a DVB adapter
refers to. Previously you had to kinda look through dmesg and hope that it
hadn't been dumped out of the buffer. This makes debugging a lot easier if
the system has been up for a long time!
This is done by adding an extra 'struct device *' parameter to
dvb_register_adapter(). It will work with any kind of standard
linux 'device'. Additionally, if someone has an embedded system which does
things differently, they can simply supply 'NULL' and the behaviour will be
as before - the link will simply not appear.
Since this affects the dvb-related files in the video4linux tree, I've sent it
to the video4linux list as well.
Patch attached - please comment.
------------------------------------------------------------------------
diff -r 4b6fdf1bb935 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Thu Apr 6 18:32:23 2006 +0100
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Thu Apr 6 19:48:44 2006 +0100
@@ -714,7 +714,7 @@ static int __init dvb_bt8xx_load_card(st
{
int result;
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE)) < 0) {
+ if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
return result;
}
Ack'd-by: Manu Abraham <manu@xxxxxxxxxxx>
_______________________________________________
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb