Patchwork [2/3] UBUNTU: SAUCE: isapnp_init: make isa PNP scans occur async

login
register
mail settings
Submitter Andy Whitcroft
Date Dec. 9, 2009, 4:05 p.m.
Message ID <1260374733-15526-3-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/40730/
State Accepted
Delegated to: Andy Whitcroft
Headers show

Comments

Andy Whitcroft - Dec. 9, 2009, 4:05 p.m.
The results of scanning for devices is to trigger udev events therefore
we can push this processing async.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/pnp/isapnp/core.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index e851160..7e4c8cd 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -42,6 +42,7 @@ 
 #include <linux/init.h>
 #include <linux/isapnp.h>
 #include <linux/mutex.h>
+#include <linux/async.h>
 #include <asm/io.h>
 
 #include "../base.h"
@@ -1002,7 +1003,7 @@  struct pnp_protocol isapnp_protocol = {
 	.disable = isapnp_disable_resources,
 };
 
-static int __init isapnp_init(void)
+static int __init real_isapnp_init(void)
 {
 	int cards;
 	struct pnp_card *card;
@@ -1096,6 +1097,15 @@  static int __init isapnp_init(void)
 	return 0;
 }
 
+static void __init async_isapnp_init(void *unused, async_cookie_t cookie)
+{
+	(void)real_isapnp_init();
+}
+
+static int __init isapnp_init(void)
+{
+       async_schedule(async_isapnp_init, NULL);
+}
 device_initcall(isapnp_init);
 
 /* format is: noisapnp */