mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Arjan van de Ven <arjan@infradead.org>,
	rusty@rustcorp.com.au, jkosina@suse.cz, mchehab@infradead.org
Subject: [PATCH 2/3] use the new request_module_nowait() in the hid driver
Date: Sun, 8 Feb 2009 10:42:40 -0800	[thread overview]
Message-ID: <20090208104240.3405903f@infradead.org> (raw)
In-Reply-To: <20090208104201.6124ab6a@infradead.org>


>From b8c36ec88e272ba2e755e6104579f1e751ee81f8 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 1 Feb 2009 12:02:39 -0800
Subject: [PATCH] use the new request_module_nowait() in the hid driver

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@linux.intel.com>
---
 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

  reply	other threads:[~2009-02-08 18:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-08 18:42 [PATCH 1/3] module: create a request_module_nowait() Arjan van de Ven
2009-02-08 18:42 ` Arjan van de Ven [this message]
2009-02-10 17:23   ` [PATCH 2/3] use the new request_module_nowait() in the hid driver Jiri Kosina
2009-02-10 22:18     ` Rusty Russell
2009-02-08 18:43 ` [PATCH 3/3] use the new request_module_nowait() in drivers/media Arjan van de Ven
2009-02-08 19:00   ` Arjan van de Ven
2009-02-09 16:34     ` Mauro Carvalho Chehab
2009-02-10 13:32       ` Rusty Russell
2009-02-10 18:37         ` Mauro Carvalho Chehab
2009-02-09  6:32 ` [PATCH 1/3] module: create a request_module_nowait() Rusty Russell
2009-02-09 15:25   ` Arjan van de Ven
2009-02-10  3:11     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090208104240.3405903f@infradead.org \
    --to=arjan@infradead.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome