summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/dvb-usb/dibusb-common.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-08-02 08:44:31 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 11:53:47 -0300
commit5a19f312162abd1356cdcda608f2b13502a383cc (patch)
treeec54b98becf8e47f215587f33e26784fc4011732 /drivers/media/dvb/dvb-usb/dibusb-common.c
parent42afd061700edb43bb082bc65a2ddde431151d6b (diff)
V4L/DVB (4465): Attach the dib3000mc correctly
Flynn Marquardt found out that there is problem with the new dib3000mc-driver when using with the real dib3000mc. It resulted in a segfault. Fixed two things: use the correct I2C address and do not attach a tuner, when the demod was previously failing. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dibusb-common.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-common.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c
index 390ced9ae4bc..6723c153e3f4 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-common.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-common.c
@@ -230,15 +230,19 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d)
{
- if (dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe) == 0) {
- if (d->priv != NULL) {
- struct dibusb_state *st = d->priv;
- st->ops.pid_parse = dib3000mc_pid_parse;
- st->ops.pid_ctrl = dib3000mc_pid_control;
- }
- return 0;
+ int ret;
+ if ((ret = dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe)) != 0)
+ return ret;
+
+ if ((ret = dib3000mc_attach(&d->i2c_adap, 1, DEFAULT_DIB3000MC_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &d->fe)) != 0)
+ return ret;
+
+ if (d->priv != NULL) {
+ struct dibusb_state *st = d->priv;
+ st->ops.pid_parse = dib3000mc_pid_parse;
+ st->ops.pid_ctrl = dib3000mc_pid_control;
}
- return -ENODEV;
+ return 0;
}
EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach);