aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-05-10 13:34:09 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-05-14 01:56:46 -0400
commit48723543aff1f46091840222490ded5fe09c0e37 (patch)
treece076b78ecae43f7ae22849277db6d496780cc8b /drivers/media/video/cx88
parent07c87a833e9ef92280ed24ab85cd4eb49cbca9c0 (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/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c10
1 files changed, 4 insertions, 6 deletions
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;