diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-05-10 13:34:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-14 01:56:46 -0400 |
commit | 48723543aff1f46091840222490ded5fe09c0e37 (patch) | |
tree | ce076b78ecae43f7ae22849277db6d496780cc8b /drivers/media/video | |
parent | 07c87a833e9ef92280ed24ab85cd4eb49cbca9c0 (diff) |
V4L/DVB (7893): xc5000: bug-fix: allow multiple devices in a single system
The current code passes a context pointer in the xc5000_config struct.
This context pointer is used in the tuner_callback function, used to
reset the device after firmware download.
The xc5000_config struct is a static structure, whose .priv member was
being assigned before calling xc5000_attach(). If there are more than
one of the same device type installed on a single system, the last one
to assign xc5000_config.priv will "win", and all others will cease to
function properly.
This patch passes the context pointer in xc5000_attach() rather that
storing it within the static struct xc5000_config.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/au0828/au0828-dvb.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 10 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 4 |
4 files changed, 10 insertions, 16 deletions
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 1371b4e4b5f1..c86a5f17eca8 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c | |||
@@ -337,12 +337,10 @@ int au0828_dvb_register(struct au0828_dev *dev) | |||
337 | dvb->frontend = dvb_attach(au8522_attach, | 337 | dvb->frontend = dvb_attach(au8522_attach, |
338 | &hauppauge_hvr950q_config, | 338 | &hauppauge_hvr950q_config, |
339 | &dev->i2c_adap); | 339 | &dev->i2c_adap); |
340 | if (dvb->frontend != NULL) { | 340 | if (dvb->frontend != NULL) |
341 | hauppauge_hvr950q_tunerconfig.priv = dev; | ||
342 | dvb_attach(xc5000_attach, dvb->frontend, | 341 | dvb_attach(xc5000_attach, dvb->frontend, |
343 | &dev->i2c_adap, | 342 | &dev->i2c_adap, |
344 | &hauppauge_hvr950q_tunerconfig); | 343 | &hauppauge_hvr950q_tunerconfig, dev); |
345 | } | ||
346 | break; | 344 | break; |
347 | default: | 345 | default: |
348 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " | 346 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 47e3f9e035f9..022aa391937a 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -384,12 +384,10 @@ static int dvb_register(struct cx23885_tsport *port) | |||
384 | port->dvb.frontend = dvb_attach(s5h1409_attach, | 384 | port->dvb.frontend = dvb_attach(s5h1409_attach, |
385 | &hauppauge_hvr1500q_config, | 385 | &hauppauge_hvr1500q_config, |
386 | &dev->i2c_bus[0].i2c_adap); | 386 | &dev->i2c_bus[0].i2c_adap); |
387 | if (port->dvb.frontend != NULL) { | 387 | if (port->dvb.frontend != NULL) |
388 | hauppauge_hvr1500q_tunerconfig.priv = i2c_bus; | ||
389 | dvb_attach(xc5000_attach, port->dvb.frontend, | 388 | dvb_attach(xc5000_attach, port->dvb.frontend, |
390 | &i2c_bus->i2c_adap, | 389 | &i2c_bus->i2c_adap, |
391 | &hauppauge_hvr1500q_tunerconfig); | 390 | &hauppauge_hvr1500q_tunerconfig, i2c_bus); |
392 | } | ||
393 | break; | 391 | break; |
394 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | 392 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
395 | i2c_bus = &dev->i2c_bus[1]; | 393 | i2c_bus = &dev->i2c_bus[1]; |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 75e2e58349ef..d96173ff1dba 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -816,11 +816,10 @@ static int dvb_register(struct cx8802_dev *dev) | |||
816 | /* tuner_config.video_dev must point to | 816 | /* tuner_config.video_dev must point to |
817 | * i2c_adap.algo_data | 817 | * i2c_adap.algo_data |
818 | */ | 818 | */ |
819 | pinnacle_pctv_hd_800i_tuner_config.priv = | ||
820 | core->i2c_adap.algo_data; | ||
821 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, | 819 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, |
822 | &core->i2c_adap, | 820 | &core->i2c_adap, |
823 | &pinnacle_pctv_hd_800i_tuner_config)) | 821 | &pinnacle_pctv_hd_800i_tuner_config, |
822 | core->i2c_adap.algo_data)) | ||
824 | goto frontend_detach; | 823 | goto frontend_detach; |
825 | } | 824 | } |
826 | break; | 825 | break; |
@@ -878,11 +877,10 @@ static int dvb_register(struct cx8802_dev *dev) | |||
878 | /* tuner_config.video_dev must point to | 877 | /* tuner_config.video_dev must point to |
879 | * i2c_adap.algo_data | 878 | * i2c_adap.algo_data |
880 | */ | 879 | */ |
881 | dvico_fusionhdtv7_tuner_config.priv = | ||
882 | core->i2c_adap.algo_data; | ||
883 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, | 880 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, |
884 | &core->i2c_adap, | 881 | &core->i2c_adap, |
885 | &dvico_fusionhdtv7_tuner_config)) | 882 | &dvico_fusionhdtv7_tuner_config, |
883 | core->i2c_adap.algo_data)) | ||
886 | goto frontend_detach; | 884 | goto frontend_detach; |
887 | } | 885 | } |
888 | break; | 886 | break; |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 4ca686fad557..5a75788b92ae 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -448,10 +448,10 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
448 | 448 | ||
449 | xc5000_cfg.i2c_address = t->i2c->addr; | 449 | xc5000_cfg.i2c_address = t->i2c->addr; |
450 | xc5000_cfg.if_khz = 5380; | 450 | xc5000_cfg.if_khz = 5380; |
451 | xc5000_cfg.priv = c->adapter->algo_data; | ||
452 | xc5000_cfg.tuner_callback = t->tuner_callback; | 451 | xc5000_cfg.tuner_callback = t->tuner_callback; |
453 | if (!dvb_attach(xc5000_attach, | 452 | if (!dvb_attach(xc5000_attach, |
454 | &t->fe, t->i2c->adapter, &xc5000_cfg)) | 453 | &t->fe, t->i2c->adapter, &xc5000_cfg, |
454 | c->adapter->algo_data)) | ||
455 | goto attach_failed; | 455 | goto attach_failed; |
456 | 456 | ||
457 | xc_tuner_ops = &t->fe.ops.tuner_ops; | 457 | xc_tuner_ops = &t->fe.ops.tuner_ops; |