diff options
author | Paul Mackerras <paulus@samba.org> | 2007-12-12 23:54:45 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-18 23:22:02 -0500 |
commit | 39d183d87791cdfd9d430df299396c0fc688ea7a (patch) | |
tree | 9eadfea154d77246861a020509a46fa821fb2f75 /drivers/macintosh/therm_pm72.c | |
parent | c61dace9a10a4bc54c764f9f490994a9d7852859 (diff) |
[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 <paulus@samba.org>
Diffstat (limited to 'drivers/macintosh/therm_pm72.c')
-rw-r--r-- | 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 e43554e754a4..6fadc9ac66b0 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -121,6 +121,7 @@ | |||
121 | #include <linux/reboot.h> | 121 | #include <linux/reboot.h> |
122 | #include <linux/kmod.h> | 122 | #include <linux/kmod.h> |
123 | #include <linux/i2c.h> | 123 | #include <linux/i2c.h> |
124 | #include <linux/kthread.h> | ||
124 | #include <asm/prom.h> | 125 | #include <asm/prom.h> |
125 | #include <asm/machdep.h> | 126 | #include <asm/machdep.h> |
126 | #include <asm/io.h> | 127 | #include <asm/io.h> |
@@ -161,7 +162,7 @@ static struct slots_pid_state slots_state; | |||
161 | static int state; | 162 | static int state; |
162 | static int cpu_count; | 163 | static int cpu_count; |
163 | static int cpu_pid_type; | 164 | static int cpu_pid_type; |
164 | static pid_t ctrl_task; | 165 | static struct task_struct *ctrl_task; |
165 | static struct completion ctrl_complete; | 166 | static struct completion ctrl_complete; |
166 | static int critical_state; | 167 | static int critical_state; |
167 | static int rackmac; | 168 | static int rackmac; |
@@ -1779,8 +1780,6 @@ static int call_critical_overtemp(void) | |||
1779 | */ | 1780 | */ |
1780 | static int main_control_loop(void *x) | 1781 | static int main_control_loop(void *x) |
1781 | { | 1782 | { |
1782 | daemonize("kfand"); | ||
1783 | |||
1784 | DBG("main_control_loop started\n"); | 1783 | DBG("main_control_loop started\n"); |
1785 | 1784 | ||
1786 | down(&driver_lock); | 1785 | down(&driver_lock); |
@@ -1956,7 +1955,7 @@ static void start_control_loops(void) | |||
1956 | { | 1955 | { |
1957 | init_completion(&ctrl_complete); | 1956 | init_completion(&ctrl_complete); |
1958 | 1957 | ||
1959 | ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | CLONE_KERNEL); | 1958 | ctrl_task = kthread_run(main_control_loop, NULL, "kfand"); |
1960 | } | 1959 | } |
1961 | 1960 | ||
1962 | /* | 1961 | /* |
@@ -1964,7 +1963,7 @@ static void start_control_loops(void) | |||
1964 | */ | 1963 | */ |
1965 | static void stop_control_loops(void) | 1964 | static void stop_control_loops(void) |
1966 | { | 1965 | { |
1967 | if (ctrl_task != 0) | 1966 | if (ctrl_task) |
1968 | wait_for_completion(&ctrl_complete); | 1967 | wait_for_completion(&ctrl_complete); |
1969 | } | 1968 | } |
1970 | 1969 | ||