diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2007-11-19 07:10:54 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2007-11-19 07:10:54 -0200 |
commit | 3773252972837d63f15b93b48d7bb75b7e8d7421 (patch) | |
tree | 4f0eaea632d554a5e273763dfda3953ae796e205 | |
parent | f8113dba6bc201cf13108067d94b7a4d0606a3eb (diff) | |
download | mediapointer-dvb-s2-3773252972837d63f15b93b48d7bb75b7e8d7421.tar.gz mediapointer-dvb-s2-3773252972837d63f15b93b48d7bb75b7e8d7421.tar.bz2 |
tm6000: Use dvb_frontend_detach instead of single symbol_put commands
From: Michel Ludwig <michel.ludwig@gmail.com>
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-- | linux/drivers/staging/tm6000/hack.c | 3 | ||||
-rw-r--r-- | linux/drivers/staging/tm6000/tm6000-dvb.c | 19 |
2 files changed, 7 insertions, 15 deletions
diff --git a/linux/drivers/staging/tm6000/hack.c b/linux/drivers/staging/tm6000/hack.c index 87f3f498e..f181fce67 100644 --- a/linux/drivers/staging/tm6000/hack.c +++ b/linux/drivers/staging/tm6000/hack.c @@ -237,8 +237,9 @@ struct dvb_frontend* pseudo_zl10353_attach(struct tm6000_core *dev, { struct tm6000_dvb *dvb = dev->dvb; - dvb->frontend = zl10353_attach(config, i2c); + dvb->frontend = dvb_attach(zl10353_attach, config, i2c); if(!dvb->frontend) { + printk(KERN_ERR "Error during zl10353_attach!\n"); return NULL; } diff --git a/linux/drivers/staging/tm6000/tm6000-dvb.c b/linux/drivers/staging/tm6000/tm6000-dvb.c index dec5e3b41..b90500ad1 100644 --- a/linux/drivers/staging/tm6000/tm6000-dvb.c +++ b/linux/drivers/staging/tm6000/tm6000-dvb.c @@ -209,12 +209,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev) return -1; } - if(dvb->frontend) { - return 0; - } - else { - return -1; - } + return (!dvb->frontend) ? -1 : 0; } int tm6000_dvb_register(struct tm6000_core *dev) @@ -230,7 +225,7 @@ int tm6000_dvb_register(struct tm6000_core *dev) ret = tm6000_dvb_attach_frontend(dev); if(ret < 0) { printk(KERN_ERR "tm6000: couldn't attach the frontend!\n"); -// goto err; + goto err; } ret = dvb_register_adapter(&dvb->adapter, "Trident TVMaster 6000 DVB-T", @@ -254,7 +249,7 @@ int tm6000_dvb_register(struct tm6000_core *dev) printk(KERN_ERR "tm6000: couldn't register " "frontend (xc3028)\n"); ret = -EINVAL; - goto adapter_err; + goto frontend_err; } printk(KERN_INFO "tm6000: XC2028/3028 asked to be " "attached to frontend!\n"); @@ -292,10 +287,8 @@ dvb_dmx_err: dvb_dmx_release(&dvb->demux); frontend_err: if(dvb->frontend) { + dvb_frontend_detach(dvb->frontend); dvb_unregister_frontend(dvb->frontend); -#ifdef CONFIG_DVB_CORE_ATTACH - symbol_put(xc3028_attach); -#endif } adapter_err: dvb_unregister_adapter(&dvb->adapter); @@ -318,10 +311,8 @@ void tm6000_dvb_unregister(struct tm6000_core *dev) // mutex_lock(&tm6000_driver.open_close_mutex); if(dvb->frontend) { + dvb_frontend_detach(dvb->frontend); dvb_unregister_frontend(dvb->frontend); -#ifdef CONFIG_DVB_CORE_ATTACH - symbol_put(xc3028_attach); -#endif } dvb_dmxdev_release(&dvb->dmxdev); |