diff options
author | Michael Krufky <mkrufky@kernellabs.com> | 2011-09-08 09:12:57 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-21 15:04:35 +0200 |
commit | 1251312a5cabd2416fd4df61941fa15ad85b0225 (patch) | |
tree | 34d1e83d9b9c2c1ccb95b5b5430f1e5ecb12cef8 /drivers/media/dvb/dvb-usb/mxl111sf.c | |
parent | [media] em28xx: add support for PCTV DVB-S2 Stick 460e [2013:024f] (diff) | |
download | linux-1251312a5cabd2416fd4df61941fa15ad85b0225.tar.xz linux-1251312a5cabd2416fd4df61941fa15ad85b0225.zip |
[media] mxl111sf: use adap->num_frontends_initialized to determine which frontend is being attached
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/mxl111sf.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/mxl111sf.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf.c b/drivers/media/dvb/dvb-usb/mxl111sf.c index 0c3f69ae946a..546ba5915a5b 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf.c @@ -379,7 +379,8 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) { struct dvb_usb_device *d = adap->dev; struct mxl111sf_state *state = d->priv; - struct mxl111sf_adap_state *adap_state = adap->fe_adap[0].priv; + int fe_id = adap->num_frontends_initialized; + struct mxl111sf_adap_state *adap_state = adap->fe_adap[fe_id].priv; int ret; deb_adv("%s()\n", __func__); @@ -422,14 +423,14 @@ static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) if (mxl_fail(ret)) goto fail; - adap->fe_adap[0].fe = dvb_attach(lgdt3305_attach, + adap->fe_adap[fe_id].fe = dvb_attach(lgdt3305_attach, &hauppauge_lgdt3305_config, &adap->dev->i2c_adap); - if (adap->fe_adap[0].fe) { - adap_state->fe_init = adap->fe_adap[0].fe->ops.init; - adap->fe_adap[0].fe->ops.init = mxl111sf_adap_fe_init; - adap_state->fe_sleep = adap->fe_adap[0].fe->ops.sleep; - adap->fe_adap[0].fe->ops.sleep = mxl111sf_adap_fe_sleep; + if (adap->fe_adap[fe_id].fe) { + adap_state->fe_init = adap->fe_adap[fe_id].fe->ops.init; + adap->fe_adap[fe_id].fe->ops.init = mxl111sf_adap_fe_init; + adap_state->fe_sleep = adap->fe_adap[fe_id].fe->ops.sleep; + adap->fe_adap[fe_id].fe->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; @@ -514,10 +515,12 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap) { struct dvb_usb_device *d = adap->dev; struct mxl111sf_state *state = d->priv; + int fe_id = adap->num_frontends_initialized; deb_adv("%s()\n", __func__); - if (NULL != dvb_attach(mxl111sf_tuner_attach, adap->fe_adap[0].fe, state, + if (NULL != dvb_attach(mxl111sf_tuner_attach, + adap->fe_adap[fe_id].fe, state, &mxl_tuner_config)) return 0; |