From bc5f06a8aaa29a79c9da2cedb5b9779b8081289c Mon Sep 17 00:00:00 2001 From: Ulrich Kunitz Date: Wed, 13 Sep 2006 02:42:12 +0100 Subject: [PATCH] zd1211rw: Added workqueue For housekeeping and watchdog tasks a workqueue is created. The central workqueue is not used to prevent crashes creates by bugs. It might be changed, when the housekeeping is stabilized. Signed-off-by: Ulrich Kunitz Signed-off-by: Daniel Drake Signed-off-by: John W. Linville --- drivers/net/wireless/zd1211rw/zd_usb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/net/wireless/zd1211rw/zd_usb.c') diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 31027e52b04..5c265ad0485 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "zd_def.h" @@ -1112,12 +1113,20 @@ static struct usb_driver driver = { .disconnect = disconnect, }; +struct workqueue_struct *zd_workqueue; + static int __init usb_init(void) { int r; pr_debug("usb_init()\n"); + zd_workqueue = create_singlethread_workqueue(driver.name); + if (zd_workqueue == NULL) { + printk(KERN_ERR "%s: couldn't create workqueue\n", driver.name); + return -ENOMEM; + } + r = usb_register(&driver); if (r) { printk(KERN_ERR "usb_register() failed. Error number %d\n", r); @@ -1132,6 +1141,7 @@ static void __exit usb_exit(void) { pr_debug("usb_exit()\n"); usb_deregister(&driver); + destroy_workqueue(zd_workqueue); } module_init(usb_init); -- cgit v1.2.3