]> Pileus Git - ~andy/linux/blobdiff - drivers/hwmon/fscher.c
Merge branch 'master' of /usr/src/ntfs-2.6/
[~andy/linux] / drivers / hwmon / fscher.c
index c7caa95c643b452ceb31aba67d836e54dcbf0bc7..a02e1c34c757db66aaf5048d3544146c057fe8d6 100644 (file)
@@ -31,7 +31,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>
 
@@ -45,7 +44,7 @@ static unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
  * Insmod parameters
  */
 
-SENSORS_INSMOD_1(fscher);
+I2C_CLIENT_INSMOD_1(fscher);
 
 /*
  * The FSCHER registers
@@ -289,7 +288,7 @@ static int fscher_attach_adapter(struct i2c_adapter *adapter)
 {
        if (!(adapter->class & I2C_CLASS_HWMON))
                return 0;
-       return i2c_detect(adapter, &addr_data, fscher_detect);
+       return i2c_probe(adapter, &addr_data, fscher_detect);
 }
 
 static int fscher_detect(struct i2c_adapter *adapter, int address, int kind)
@@ -304,11 +303,10 @@ static int fscher_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 i2c_smbus_read_byte_data. */
-       if (!(data = kmalloc(sizeof(struct fscher_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct fscher_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       memset(data, 0, sizeof(struct fscher_data));
 
        /* The common I2C client data is placed right before the
         * Hermes-specific data. */
@@ -383,11 +381,8 @@ static int fscher_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;