diff options
author | Michel Ludwig <michel.ludwig@gmail.com> | 2007-11-19 04:10:54 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:40:01 -0400 |
commit | 70bfae5aaf7254f3cdfc1647441ff2b595933f09 (patch) | |
tree | aa2420e45eabff4b23fd9bc33c4c0e1ac5bdb388 | |
parent | e762d420b4d8ba120cb5c85c484e09792e6b8a44 (diff) |
V4L/DVB (12818): tm6000: Use dvb_frontend_detach instead of single symbol_put commands
Thanks to Mike Krufky for pointed that one out. Also include some minor
cleanups.
Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/staging/tm6000/hack.c | 3 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-dvb.c | 19 |
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/staging/tm6000/hack.c b/drivers/staging/tm6000/hack.c index 87f3f498e8eb..f181fce6716b 100644 --- a/drivers/staging/tm6000/hack.c +++ b/drivers/staging/tm6000/hack.c | |||
@@ -237,8 +237,9 @@ struct dvb_frontend* pseudo_zl10353_attach(struct tm6000_core *dev, | |||
237 | { | 237 | { |
238 | struct tm6000_dvb *dvb = dev->dvb; | 238 | struct tm6000_dvb *dvb = dev->dvb; |
239 | 239 | ||
240 | dvb->frontend = zl10353_attach(config, i2c); | 240 | dvb->frontend = dvb_attach(zl10353_attach, config, i2c); |
241 | if(!dvb->frontend) { | 241 | if(!dvb->frontend) { |
242 | printk(KERN_ERR "Error during zl10353_attach!\n"); | ||
242 | return NULL; | 243 | return NULL; |
243 | } | 244 | } |
244 | 245 | ||
diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c index b423795f0017..fa6d3a00f9b0 100644 --- a/drivers/staging/tm6000/tm6000-dvb.c +++ b/drivers/staging/tm6000/tm6000-dvb.c | |||
@@ -205,12 +205,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev) | |||
205 | return -1; | 205 | return -1; |
206 | } | 206 | } |
207 | 207 | ||
208 | if(dvb->frontend) { | 208 | return (!dvb->frontend) ? -1 : 0; |
209 | return 0; | ||
210 | } | ||
211 | else { | ||
212 | return -1; | ||
213 | } | ||
214 | } | 209 | } |
215 | 210 | ||
216 | int tm6000_dvb_register(struct tm6000_core *dev) | 211 | int tm6000_dvb_register(struct tm6000_core *dev) |
@@ -226,7 +221,7 @@ int tm6000_dvb_register(struct tm6000_core *dev) | |||
226 | ret = tm6000_dvb_attach_frontend(dev); | 221 | ret = tm6000_dvb_attach_frontend(dev); |
227 | if(ret < 0) { | 222 | if(ret < 0) { |
228 | printk(KERN_ERR "tm6000: couldn't attach the frontend!\n"); | 223 | printk(KERN_ERR "tm6000: couldn't attach the frontend!\n"); |
229 | // goto err; | 224 | goto err; |
230 | } | 225 | } |
231 | 226 | ||
232 | ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T", | 227 | ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T", |
@@ -250,7 +245,7 @@ int tm6000_dvb_register(struct tm6000_core *dev) | |||
250 | printk(KERN_ERR "tm6000: couldn't register " | 245 | printk(KERN_ERR "tm6000: couldn't register " |
251 | "frontend (xc3028)\n"); | 246 | "frontend (xc3028)\n"); |
252 | ret = -EINVAL; | 247 | ret = -EINVAL; |
253 | goto adapter_err; | 248 | goto frontend_err; |
254 | } | 249 | } |
255 | printk(KERN_INFO "tm6000: XC2028/3028 asked to be " | 250 | printk(KERN_INFO "tm6000: XC2028/3028 asked to be " |
256 | "attached to frontend!\n"); | 251 | "attached to frontend!\n"); |
@@ -288,10 +283,8 @@ dvb_dmx_err: | |||
288 | dvb_dmx_release(&dvb->demux); | 283 | dvb_dmx_release(&dvb->demux); |
289 | frontend_err: | 284 | frontend_err: |
290 | if(dvb->frontend) { | 285 | if(dvb->frontend) { |
286 | dvb_frontend_detach(dvb->frontend); | ||
291 | dvb_unregister_frontend(dvb->frontend); | 287 | dvb_unregister_frontend(dvb->frontend); |
292 | #ifdef CONFIG_DVB_CORE_ATTACH | ||
293 | symbol_put(xc3028_attach); | ||
294 | #endif | ||
295 | } | 288 | } |
296 | adapter_err: | 289 | adapter_err: |
297 | dvb_unregister_adapter(&dvb->adapter); | 290 | dvb_unregister_adapter(&dvb->adapter); |
@@ -314,10 +307,8 @@ void tm6000_dvb_unregister(struct tm6000_core *dev) | |||
314 | 307 | ||
315 | // mutex_lock(&tm6000_driver.open_close_mutex); | 308 | // mutex_lock(&tm6000_driver.open_close_mutex); |
316 | if(dvb->frontend) { | 309 | if(dvb->frontend) { |
310 | dvb_frontend_detach(dvb->frontend); | ||
317 | dvb_unregister_frontend(dvb->frontend); | 311 | dvb_unregister_frontend(dvb->frontend); |
318 | #ifdef CONFIG_DVB_CORE_ATTACH | ||
319 | symbol_put(xc3028_attach); | ||
320 | #endif | ||
321 | } | 312 | } |
322 | 313 | ||
323 | dvb_dmxdev_release(&dvb->dmxdev); | 314 | dvb_dmxdev_release(&dvb->dmxdev); |