diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-08-02 13:44:31 +0200 |
---|---|---|
committer | Patrick Boettcher <pb@linuxtv.org> | 2006-08-02 13:44:31 +0200 |
commit | 975b1fde51670c1fc807e6a31b4d269f1ecfc03a (patch) | |
tree | b83cc127b1253b618e88cc6e3afe6b14cbdb42be | |
parent | 023c6aeff851c8703bf2eaf7c02dc8b85af3261b (diff) | |
download | mediapointer-dvb-s2-975b1fde51670c1fc807e6a31b4d269f1ecfc03a.tar.gz mediapointer-dvb-s2-975b1fde51670c1fc807e6a31b4d269f1ecfc03a.tar.bz2 |
Attach the dib3000mc correctly
From: Patrick Boettcher <pb@linuxtv.org>
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>
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dibusb-common.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 7 |
2 files changed, 16 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c index 390ced9ae..6723c153e 100644 --- a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/linux/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); diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index 48ceba61e..9dfa3e24d 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c @@ -190,12 +190,13 @@ int dvb_usb_fe_init(struct dvb_usb_device* d) d->fe = NULL; return -ENODEV; } + + /* only attach the tuner if the demod is there */ + if (d->props.tuner_attach != NULL) + d->props.tuner_attach(d); } else err("no frontend was attached by '%s'",d->desc->name); - if (d->props.tuner_attach != NULL) - d->props.tuner_attach(d); - return 0; } |