[PATCH] hwmon: kzalloc conversion
[pandora-kernel.git] / drivers / hwmon / lm75.c
index a2bebb6..d70f4c8 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
-#include <linux/i2c-sensor.h>
 #include <linux/hwmon.h>
 #include <linux/err.h>
 #include "lm75.h"
@@ -34,7 +33,7 @@ static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c,
                                        0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_1(lm75);
+I2C_CLIENT_INSMOD_1(lm75);
 
 /* Many LM75 constants specified below */
 
@@ -109,10 +108,10 @@ static int lm75_attach_adapter(struct i2c_adapter *adapter)
 {
        if (!(adapter->class & I2C_CLASS_HWMON))
                return 0;
-       return i2c_detect(adapter, &addr_data, lm75_detect);
+       return i2c_probe(adapter, &addr_data, lm75_detect);
 }
 
-/* This function is called by i2c_detect */
+/* This function is called by i2c_probe */
 static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
 {
        int i;
@@ -128,11 +127,10 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
        /* OK. For now, we presume we have a valid client. We now create the
           client structure, even though we cannot fill it completely yet.
           But it allows us to access lm75_{read,write}_value. */
-       if (!(data = kmalloc(sizeof(struct lm75_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct lm75_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       memset(data, 0, sizeof(struct lm75_data));
 
        new_client = &data->client;
        i2c_set_clientdata(new_client, data);