Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81071
b: refs/heads/master
c: 98f6740
h: refs/heads/master
i:
  81069: 6135f17
  81067: 2cc3ff8
  81063: c77bc19
  81055: d00fd25
v: v3
  • Loading branch information
Paul Mackerras committed Dec 19, 2007
1 parent edf0c53 commit acd6dde
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39d183d87791cdfd9d430df299396c0fc688ea7a
refs/heads/master: 98f6740ea6d532550c4010960fcead2c32bd56f5
34 changes: 17 additions & 17 deletions trunk/drivers/macintosh/therm_windtunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/kthread.h>

#include <asm/prom.h>
#include <asm/machdep.h>
Expand All @@ -61,8 +62,7 @@ I2C_CLIENT_INSMOD;

static struct {
volatile int running;
struct completion completion;
pid_t poll_task;
struct task_struct *poll_task;

struct semaphore lock;
struct of_device *of_dev;
Expand Down Expand Up @@ -282,27 +282,27 @@ restore_regs( void )
write_reg( x.fan, 0x00, x.r0, 1 );
}

static int
control_loop( void *dummy )
static int control_loop(void *dummy)
{
daemonize("g4fand");

down( &x.lock );
down(&x.lock);
setup_hardware();
up(&x.lock);

while( x.running ) {
up( &x.lock );

for (;;) {
msleep_interruptible(8000);

down( &x.lock );
if (kthread_should_stop())
break;

down(&x.lock);
poll_temp();
up(&x.lock);
}

down(&x.lock);
restore_regs();
up( &x.lock );
up(&x.lock);

complete_and_exit( &x.completion, 0 );
return 0;
}


Expand All @@ -322,8 +322,7 @@ do_attach( struct i2c_adapter *adapter )
ret = i2c_probe( adapter, &addr_data, &do_probe );
if( x.thermostat && x.fan ) {
x.running = 1;
init_completion( &x.completion );
x.poll_task = kernel_thread( control_loop, NULL, SIGCHLD | CLONE_KERNEL );
x.poll_task = kthread_run(control_loop, NULL, "g4fand");
}
}
return ret;
Expand All @@ -339,7 +338,8 @@ do_detach( struct i2c_client *client )
else {
if( x.running ) {
x.running = 0;
wait_for_completion( &x.completion );
kthread_stop(x.poll_task);
x.poll_task = NULL;
}
if( client == x.thermostat )
x.thermostat = NULL;
Expand Down

0 comments on commit acd6dde

Please sign in to comment.