diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-dvb.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index ec631708c394..fe6208ada903 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | |||
@@ -175,36 +175,36 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) | |||
175 | int dvb_usb_fe_init(struct dvb_usb_device* d) | 175 | int dvb_usb_fe_init(struct dvb_usb_device* d) |
176 | { | 176 | { |
177 | if (d->props.frontend_attach == NULL) { | 177 | if (d->props.frontend_attach == NULL) { |
178 | err("strange '%s' doesn't want to attach a frontend.",d->desc->name); | 178 | err("strange: '%s' doesn't want to attach a frontend.",d->desc->name); |
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
182 | d->props.frontend_attach(d); | ||
183 | |||
184 | /* re-assign sleep and wakeup functions */ | 182 | /* re-assign sleep and wakeup functions */ |
185 | if (d->fe != NULL) { | 183 | if (d->props.frontend_attach(d) == 0 && d->fe != NULL) { |
186 | d->fe_init = d->fe->ops.init; d->fe->ops.init = dvb_usb_fe_wakeup; | 184 | d->fe_init = d->fe->ops.init; d->fe->ops.init = dvb_usb_fe_wakeup; |
187 | d->fe_sleep = d->fe->ops.sleep; d->fe->ops.sleep = dvb_usb_fe_sleep; | 185 | d->fe_sleep = d->fe->ops.sleep; d->fe->ops.sleep = dvb_usb_fe_sleep; |
188 | 186 | ||
189 | if (dvb_register_frontend(&d->dvb_adap, d->fe)) { | 187 | if (dvb_register_frontend(&d->dvb_adap, d->fe)) { |
190 | err("Frontend registration failed."); | 188 | err("Frontend registration failed."); |
191 | if (d->fe->ops.release) | 189 | dvb_frontend_detach(d->fe); |
192 | d->fe->ops.release(d->fe); | ||
193 | d->fe = NULL; | 190 | d->fe = NULL; |
194 | return -ENODEV; | 191 | return -ENODEV; |
195 | } | 192 | } |
193 | |||
194 | /* only attach the tuner if the demod is there */ | ||
195 | if (d->props.tuner_attach != NULL) | ||
196 | d->props.tuner_attach(d); | ||
196 | } else | 197 | } else |
197 | err("no frontend was attached by '%s'",d->desc->name); | 198 | err("no frontend was attached by '%s'",d->desc->name); |
198 | 199 | ||
199 | if (d->props.tuner_attach != NULL) | ||
200 | d->props.tuner_attach(d); | ||
201 | |||
202 | return 0; | 200 | return 0; |
203 | } | 201 | } |
204 | 202 | ||
205 | int dvb_usb_fe_exit(struct dvb_usb_device *d) | 203 | int dvb_usb_fe_exit(struct dvb_usb_device *d) |
206 | { | 204 | { |
207 | if (d->fe != NULL) | 205 | if (d->fe != NULL) { |
208 | dvb_unregister_frontend(d->fe); | 206 | dvb_unregister_frontend(d->fe); |
207 | dvb_frontend_detach(d->fe); | ||
208 | } | ||
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |