diff options
Diffstat (limited to 'linux/drivers/media/mdtv/smsusb.c')
-rw-r--r-- | linux/drivers/media/mdtv/smsusb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/linux/drivers/media/mdtv/smsusb.c b/linux/drivers/media/mdtv/smsusb.c index 99e600c33..df2b82801 100644 --- a/linux/drivers/media/mdtv/smsusb.c +++ b/linux/drivers/media/mdtv/smsusb.c @@ -405,12 +405,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; @@ -418,6 +427,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__); } |