some kmalloc/memset ->kzalloc (tree wide)
[cascardo/linux.git] / drivers / macintosh / therm_pm72.c
index 2e4ad44..e43554e 100644 (file)
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/wait.h>
 #include <linux/reboot.h>
 #include <linux/kmod.h>
@@ -319,10 +318,9 @@ static struct i2c_client *attach_i2c_chip(int id, const char *name)
        if (adap == NULL)
                return NULL;
 
-       clt = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+       clt = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
        if (clt == NULL)
                return NULL;
-       memset(clt, 0, sizeof(struct i2c_client));
 
        clt->addr = (id >> 1) & 0x7f;
        clt->adapter = adap;
@@ -674,7 +672,7 @@ static int read_eeprom(int cpu, struct mpu_data *out)
                printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n");
                return -ENODEV;
        }
-       data = get_property(np, "cpuid", &len);
+       data = of_get_property(np, "cpuid", &len);
        if (data == NULL) {
                printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n");
                of_node_put(np);
@@ -1337,7 +1335,7 @@ static int init_backside_state(struct backside_pid_state *state)
         */
        u3 = of_find_node_by_path("/u3@0,f8000000");
        if (u3 != NULL) {
-               const u32 *vers = get_property(u3, "device-rev", NULL);
+               const u32 *vers = of_get_property(u3, "device-rev", NULL);
                if (vers)
                        if (((*vers) & 0x3f) < 0x34)
                                u3h = 0;
@@ -1771,7 +1769,8 @@ static int call_critical_overtemp(void)
                                "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
                                NULL };
 
-       return call_usermodehelper(critical_overtemp_path, argv, envp, 0);
+       return call_usermodehelper(critical_overtemp_path,
+                                  argv, envp, UMH_WAIT_EXEC);
 }
 
 
@@ -2129,8 +2128,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
                        continue;
 
                /* Lookup for a matching location */
-               loc = get_property(np, "location", NULL);
-               reg = get_property(np, "reg", NULL);
+               loc = of_get_property(np, "location", NULL);
+               reg = of_get_property(np, "reg", NULL);
                if (loc == NULL || reg == NULL)
                        continue;
                DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg);