提交 bc5f06a8 编写于 作者: U Ulrich Kunitz 提交者: John W. Linville

[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: NUlrich Kunitz <kune@deine-taler.de>
Signed-off-by: NDaniel Drake <dsd@gentoo.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 44976c66
......@@ -24,6 +24,7 @@
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/usb.h>
#include <linux/workqueue.h>
#include <net/ieee80211.h>
#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);
......
......@@ -238,4 +238,6 @@ int zd_usb_iowrite16v(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits);
extern struct workqueue_struct *zd_workqueue;
#endif /* _ZD_USB_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册