]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/hwmon/gl518sm.c
Pull memoryless-node-allocation into release branch
[karo-tx-linux.git] / drivers / hwmon / gl518sm.c
index 63a2756c283a97a3f9c2bf89b1e523616a38df64..2f178dbe3d87f5d624d467782c9237625ddada15 100644 (file)
@@ -41,7 +41,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>
 
@@ -49,7 +48,7 @@
 static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_2(gl518sm_r00, gl518sm_r80);
+I2C_CLIENT_INSMOD_2(gl518sm_r00, gl518sm_r80);
 
 /* Many GL518 constants specified below */
 
@@ -348,7 +347,7 @@ static int gl518_attach_adapter(struct i2c_adapter *adapter)
 {
        if (!(adapter->class & I2C_CLASS_HWMON))
                return 0;
-       return i2c_detect(adapter, &addr_data, gl518_detect);
+       return i2c_probe(adapter, &addr_data, gl518_detect);
 }
 
 static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
@@ -366,11 +365,10 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
           client structure, even though we cannot fill it completely yet.
           But it allows us to access gl518_{read,write}_value. */
 
-       if (!(data = kmalloc(sizeof(struct gl518_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct gl518_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       memset(data, 0, sizeof(struct gl518_data));
 
        new_client = &data->client;
        i2c_set_clientdata(new_client, data);