]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/macintosh/therm_adt746x.c
hpt366: kill set_dma_mode() method wrapper
[linux-2.6-omap-h63xx.git] / drivers / macintosh / therm_adt746x.c
index 178afa1fd56c0ad899ec4a255cdf01fe2db2f114..276945d515130724e2c575b0a538aa8106b2449b 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/wait.h>
 #include <linux/suspend.h>
 #include <linux/kthread.h>
@@ -336,6 +335,7 @@ static int monitor_task(void *arg)
 {
        struct thermostat* th = arg;
 
+       set_freezable();
        while(!kthread_should_stop()) {
                try_to_freeze();
                msleep_interruptible(2000);
@@ -379,13 +379,10 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
        if (thermostat)
                return 0;
 
-       th = (struct thermostat *)
-               kmalloc(sizeof(struct thermostat), GFP_KERNEL);
-
+       th = kzalloc(sizeof(struct thermostat), GFP_KERNEL);
        if (!th)
                return -ENOMEM;
 
-       memset(th, 0, sizeof(*th));
        th->clt.addr = addr;
        th->clt.adapter = adapter;
        th->clt.driver = &thermostat_driver;