aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-10 08:27:37 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:57:55 -0400
commitd09dbf92ada861244056d914a8f68b8be99891ed (patch)
tree3746d352f1d3df6a069c7b740717706ec50a1981 /drivers/media/video
parent76d313bfea356550a614be51454d526e5090014d (diff)
V4L/DVB (3762): Add sysfs device links to dvb devices
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. Ack'd-by: Manu Abraham <manu@linuxtv.org> Acked-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/video-buf-dvb.c5
3 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 5c05e09e73fa..28e0d3d94515 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -722,7 +722,7 @@ static int dvb_register(struct cx8802_dev *dev)
722 cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); 722 cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
723 723
724 /* register everything */ 724 /* register everything */
725 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev); 725 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
726} 726}
727 727
728/* ----------------------------------------------------------- */ 728/* ----------------------------------------------------------- */
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 222a36c38917..98a492ddc216 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1088,7 +1088,7 @@ static int dvb_init(struct saa7134_dev *dev)
1088 } 1088 }
1089 1089
1090 /* register everything else */ 1090 /* register everything else */
1091 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev); 1091 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
1092} 1092}
1093 1093
1094static int dvb_fini(struct saa7134_dev *dev) 1094static int dvb_fini(struct saa7134_dev *dev)
diff --git a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c
index caf3e7e2f219..7ee8a53cd336 100644
--- a/drivers/media/video/video-buf-dvb.c
+++ b/drivers/media/video/video-buf-dvb.c
@@ -135,14 +135,15 @@ static int videobuf_dvb_stop_feed(struct dvb_demux_feed *feed)
135 135
136int videobuf_dvb_register(struct videobuf_dvb *dvb, 136int videobuf_dvb_register(struct videobuf_dvb *dvb,
137 struct module *module, 137 struct module *module,
138 void *adapter_priv) 138 void *adapter_priv,
139 struct device *device)
139{ 140{
140 int result; 141 int result;
141 142
142 mutex_init(&dvb->lock); 143 mutex_init(&dvb->lock);
143 144
144 /* register adapter */ 145 /* register adapter */
145 result = dvb_register_adapter(&dvb->adapter, dvb->name, module); 146 result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device);
146 if (result < 0) { 147 if (result < 0) {
147 printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n", 148 printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
148 dvb->name, result); 149 dvb->name, result);