V4L/DVB (3488): Snd_cx88_create: don't dereference NULL core
[safe/jmp/linux-2.6] / drivers / hwmon / gl518sm.c
index 15376a6..9e685e3 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 */
 
@@ -152,10 +151,10 @@ static struct gl518_data *gl518_update_device(struct device *dev);
 
 /* This is the driver that will be inserted */
 static struct i2c_driver gl518_driver = {
-       .owner          = THIS_MODULE,
-       .name           = "gl518sm",
+       .driver = {
+               .name   = "gl518sm",
+       },
        .id             = I2C_DRIVERID_GL518,
-       .flags          = I2C_DF_NOTIFY,
        .attach_adapter = gl518_attach_adapter,
        .detach_client  = gl518_detach_client,
 };
@@ -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);