Commit e0568ece authored by Colin Leroy's avatar Colin Leroy Committed by Linus Torvalds

[PATCH] therm_adt746x: don't change loadavg

Use interruptible sleep rather than uninterruptible.

Partially convert it to the kthread API so the kernel thread doesn't get
accidentally signalled.
Signed-off-by: default avatarColin Leroy <colin@colino.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bce2e8bc
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/of_device.h> #include <asm/of_device.h>
#include <linux/kthread.h>
#undef DEBUG #undef DEBUG
...@@ -70,7 +71,6 @@ static enum {ADT7460, ADT7467} therm_type; ...@@ -70,7 +71,6 @@ static enum {ADT7460, ADT7467} therm_type;
static int therm_bus, therm_address; static int therm_bus, therm_address;
static struct of_device * of_dev; static struct of_device * of_dev;
static struct thermostat* thermostat; static struct thermostat* thermostat;
static pid_t monitor_thread_id;
static int monitor_running; static int monitor_running;
static struct completion monitor_task_compl; static struct completion monitor_task_compl;
...@@ -237,16 +237,11 @@ static int monitor_task(void *arg) ...@@ -237,16 +237,11 @@ static int monitor_task(void *arg)
#ifdef DEBUG #ifdef DEBUG
int mfan_speed; int mfan_speed;
#endif #endif
lock_kernel();
daemonize("kfand");
unlock_kernel();
strcpy(current->comm, "thermostat");
monitor_running = 1; monitor_running = 1;
while(monitor_running) while(monitor_running)
{ {
msleep(2000); msleep_interruptible(2000);
/* Check status */ /* Check status */
/* local : chip */ /* local : chip */
...@@ -405,8 +400,7 @@ attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno) ...@@ -405,8 +400,7 @@ attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno)
init_completion(&monitor_task_compl); init_completion(&monitor_task_compl);
monitor_thread_id = kernel_thread(monitor_task, th, kthread_run(monitor_task, th, "kfand");
SIGCHLD | CLONE_KERNEL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment