diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-05-22 18:01:02 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 07:20:18 -0300 |
commit | 3dd243787017e40c66ae54cf590ea513a110c51d (patch) | |
tree | 7384df276d2b524e9ead1b303d49ebbc07aaf588 /drivers/media/mdtv/smsusb.c | |
parent | 7a19598c75660b6d4464d291f8e99a91fd7afc4a (diff) | |
download | lwn-3dd243787017e40c66ae54cf590ea513a110c51d.tar.gz lwn-3dd243787017e40c66ae54cf590ea513a110c51d.zip |
V4L/DVB (8266): sms1xxx: merge modules
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/mdtv/smsusb.c')
-rw-r--r-- | drivers/media/mdtv/smsusb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/mdtv/smsusb.c b/drivers/media/mdtv/smsusb.c index 1da0209fc56f..11c471ad6326 100644 --- a/drivers/media/mdtv/smsusb.c +++ b/drivers/media/mdtv/smsusb.c @@ -401,12 +401,21 @@ static struct usb_driver smsusb_driver = { .id_table = smsusb_id_table, }; +extern struct list_head g_smsdvb_clients; +kmutex_t g_smsdvb_clientslock; + int smsusb_module_init(void) { int rc = usb_register(&smsusb_driver); if (rc) printk(KERN_INFO "usb_register failed. Error number %d\n", rc); + /* Bring up the dvb componenets */ + INIT_LIST_HEAD(&g_smsdvb_clients); + kmutex_init(&g_smsdvb_clientslock); + + rc = smscore_register_hotplug(smsdvb_hotplug); + printk(KERN_INFO "%s\n", __FUNCTION__); return rc; @@ -414,6 +423,17 @@ int smsusb_module_init(void) void smsusb_module_exit(void) { + /* Tear down the DVB components */ + smscore_unregister_hotplug(smsdvb_hotplug); + + kmutex_lock(&g_smsdvb_clientslock); + + while (!list_empty(&g_smsdvb_clients)) + smsdvb_unregister_client((smsdvb_client_t*) g_smsdvb_clients.next); + + kmutex_unlock(&g_smsdvb_clientslock); + + /* Regular USB Cleanup */ usb_deregister(&smsusb_driver); printk(KERN_INFO "%s\n", __FUNCTION__); } |