]> err.no Git - linux-2.6/blobdiff - drivers/hwmon/fscpos.c
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[linux-2.6] / drivers / hwmon / fscpos.c
index 4cb33b231124e67f075f01f4d09c3a1eb2e4876a..64e4edc64f8d40bcd93f8d0c4c4978b7dd9f6b2c 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
-#include <linux/i2c-sensor.h>
 #include <linux/init.h>
 #include <linux/hwmon.h>
 #include <linux/err.h>
  * Addresses to scan
  */
 static unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
-static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
 
 /*
  * Insmod parameters
  */
-SENSORS_INSMOD_1(fscpos);
+I2C_CLIENT_INSMOD_1(fscpos);
 
 /*
  * The FSCPOS registers
@@ -437,10 +435,10 @@ static int fscpos_attach_adapter(struct i2c_adapter *adapter)
 {
        if (!(adapter->class & I2C_CLASS_HWMON))
                return 0;
-       return i2c_detect(adapter, &addr_data, fscpos_detect);
+       return i2c_probe(adapter, &addr_data, fscpos_detect);
 }
 
-int fscpos_detect(struct i2c_adapter *adapter, int address, int kind)
+static int fscpos_detect(struct i2c_adapter *adapter, int address, int kind)
 {
        struct i2c_client *new_client;
        struct fscpos_data *data;
@@ -455,11 +453,10 @@ int fscpos_detect(struct i2c_adapter *adapter, int address, int kind)
         * But it allows us to access fscpos_{read,write}_value.
         */
 
-       if (!(data = kmalloc(sizeof(struct fscpos_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct fscpos_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       memset(data, 0, sizeof(struct fscpos_data));
 
        new_client = &data->client;
        i2c_set_clientdata(new_client, data);
@@ -550,11 +547,8 @@ static int fscpos_detach_client(struct i2c_client *client)
 
        hwmon_device_unregister(data->class_dev);
 
-       if ((err = i2c_detach_client(client))) {
-               dev_err(&client->dev, "Client deregistration failed, client"
-                                                       " not detached.\n");
+       if ((err = i2c_detach_client(client)))
                return err;
-       }
        kfree(data);
        return 0;
 }