Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db9c02fa8bd50eb104781a9f78cae923d8da1e74
Commit:     db9c02fa8bd50eb104781a9f78cae923d8da1e74
Parent:     1bd0cf1fc78e59e1d2b4e44348a85d39b983c80d
Author:     Eric W. Biederman <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:30:17 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:11 2007 -0700

    pnpbios: convert to use the kthread API
    
    This patches modifies the pnpbios kernel thread to start with ktrhead_run
    not kernel_thread and deamonize.  Doing this makes the code a little
    simpler and easier to maintain.
    
    Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Cc: Adam Belay <[EMAIL PROTECTED]>
    Cc: Bjorn Helgaas <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/pnp/pnpbios/core.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 95738db..b71aff2 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -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,7 @@ 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))
+       while (!unloading)
        {
                int status;
                
@@ -170,11 +169,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);
 
@@ -581,6 +577,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 +586,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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to