Commit 5a19f312 authored by Patrick Boettcher's avatar Patrick Boettcher Committed by Mauro Carvalho Chehab
Browse files

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: default avatarPatrick Boettcher <pb@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 42afd061
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -230,7 +230,13 @@ 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) {
	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;
@@ -238,8 +244,6 @@ int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d)
	}
	return 0;
}
	return -ENODEV;
}
EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach);

static struct mt2060_config stk3000p_mt2060_config = {
+4 −3
Original line number Diff line number Diff line
@@ -191,11 +191,12 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
			d->fe = NULL;
			return -ENODEV;
		}
	} else
		err("no frontend was attached by '%s'",d->desc->name);

		/* 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);

	return 0;
}