]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pnp/pnpbios/core.c
Freezer: make kernel threads nonfreezable by default
[linux-2.6-omap-h63xx.git] / drivers / pnp / pnpbios / core.c
index 95738dbd5d4555cec6428595b06ce72cd32aa8be..03baf1c64a2e04fa2307f37b504b3862e9837350 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/delay.h>
 #include <linux/acpi.h>
 #include <linux/freezer.h>
+#include <linux/kthread.h>
 
 #include <asm/page.h>
 #include <asm/desc.h>
@@ -159,9 +160,8 @@ static int pnp_dock_thread(void * unused)
 {
        static struct pnp_docking_station_info now;
        int docked = -1, d = 0;
-       daemonize("kpnpbiosd");
-       allow_signal(SIGKILL);
-       while(!unloading && !signal_pending(current))
+       set_freezable();
+       while (!unloading)
        {
                int status;
                
@@ -170,11 +170,8 @@ static int pnp_dock_thread(void * unused)
                 */
                msleep_interruptible(2000);
 
-               if(signal_pending(current)) {
-                       if (try_to_freeze())
-                               continue;
-                       break;
-               }
+               if (try_to_freeze())
+                       continue;
 
                status = pnp_bios_dock_station_info(&now);
 
@@ -574,6 +571,7 @@ static int __init pnpbios_init(void)
        /* scan for pnpbios devices */
        build_devlist();
 
+       pnp_platform_devices = 1;
        return 0;
 }
 
@@ -581,6 +579,7 @@ subsys_initcall(pnpbios_init);
 
 static int __init pnpbios_thread_init(void)
 {
+       struct task_struct *task;
 #if defined(CONFIG_PPC_MERGE)
        if (check_legacy_ioport(PNPBIOS_BASE))
                return 0;
@@ -589,7 +588,8 @@ static int __init pnpbios_thread_init(void)
                return 0;
 #ifdef CONFIG_HOTPLUG
        init_completion(&unload_sem);
-       if (kernel_thread(pnp_dock_thread, NULL, CLONE_KERNEL) > 0)
+       task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
+       if (!IS_ERR(task))
                unloading = 0;
 #endif
        return 0;