Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=39d183d87791cdfd9d430df299396c0fc688ea7a
Commit:     39d183d87791cdfd9d430df299396c0fc688ea7a
Parent:     c61dace9a10a4bc54c764f9f490994a9d7852859
Author:     Paul Mackerras <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 13 15:54:45 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Dec 19 15:22:02 2007 +1100

    [POWERPC] Convert therm_pm72.c to use the kthread API
    
    This converts the therm_pm72.c driver to use the kthread API.  I
    thought about making it use kthread_stop() instead of the `state'
    variable and the `ctrl_complete' completion, but that isn't simple and
    will require changing the way that `state' is used.
    
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 drivers/macintosh/therm_pm72.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index e43554e..6fadc9a 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -121,6 +121,7 @@
 #include <linux/reboot.h>
 #include <linux/kmod.h>
 #include <linux/i2c.h>
+#include <linux/kthread.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
@@ -161,7 +162,7 @@ static struct slots_pid_state               slots_state;
 static int                             state;
 static int                             cpu_count;
 static int                             cpu_pid_type;
-static pid_t                           ctrl_task;
+static struct task_struct              *ctrl_task;
 static struct completion               ctrl_complete;
 static int                             critical_state;
 static int                             rackmac;
@@ -1779,8 +1780,6 @@ static int call_critical_overtemp(void)
  */
 static int main_control_loop(void *x)
 {
-       daemonize("kfand");
-
        DBG("main_control_loop started\n");
 
        down(&driver_lock);
@@ -1956,7 +1955,7 @@ static void start_control_loops(void)
 {
        init_completion(&ctrl_complete);
 
-       ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | 
CLONE_KERNEL);
+       ctrl_task = kthread_run(main_control_loop, NULL, "kfand");
 }
 
 /*
@@ -1964,7 +1963,7 @@ static void start_control_loops(void)
  */
 static void stop_control_loops(void)
 {
-       if (ctrl_task != 0)
+       if (ctrl_task)
                wait_for_completion(&ctrl_complete);
 }
 
-
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