[PATCH] use the new request_module_nowait() in the hid driver

From: Arjan van de Ven
Date: Sun Feb 01 2009 - 15:02:39 EST


Now that there is a request_module_nowait(), use it in the hid driver.
This gets rid of a kernel thread, and also greatly simplifies the code...

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
---
drivers/hid/hid-core.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 6cad69e..d51331f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1812,15 +1812,6 @@ void hid_unregister_driver(struct hid_driver *hdrv)
}
EXPORT_SYMBOL_GPL(hid_unregister_driver);

-#ifdef CONFIG_HID_COMPAT
-static void hid_compat_load(struct work_struct *ws)
-{
- request_module("hid-dummy");
-}
-static DECLARE_WORK(hid_compat_work, hid_compat_load);
-static struct workqueue_struct *hid_compat_wq;
-#endif
-
static int __init hid_init(void)
{
int ret;
@@ -1836,12 +1827,7 @@ static int __init hid_init(void)
goto err_bus;

#ifdef CONFIG_HID_COMPAT
- hid_compat_wq = create_singlethread_workqueue("hid_compat");
- if (!hid_compat_wq) {
- hidraw_exit();
- goto err;
- }
- queue_work(hid_compat_wq, &hid_compat_work);
+ request_module_nowait("hid-dummy");
#endif

return 0;
@@ -1853,9 +1839,6 @@ err:

static void __exit hid_exit(void)
{
-#ifdef CONFIG_HID_COMPAT
- destroy_workqueue(hid_compat_wq);
-#endif
hidraw_exit();
bus_unregister(&hid_bus_type);
}
--
1.6.0.6


--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/