]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hwmon/lm85.c
Merge rsync://bughost.org/repos/ieee80211-delta/
[linux-2.6-omap-h63xx.git] / drivers / hwmon / lm85.c
index 8976565113f490e9ff1e676c4bc063597385fe4a..d1070ed2bee617d20ca9604442f3d61f0a225f2b 100644 (file)
 #include <linux/slab.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
-#include <linux/i2c-sensor.h>
-#include <linux/i2c-vid.h>
 #include <linux/hwmon.h>
+#include <linux/hwmon-vid.h>
 #include <linux/err.h>
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
+I2C_CLIENT_INSMOD_6(lm85b, lm85c, adm1027, adt7463, emc6d100, emc6d102);
 
 /* The LM85 registers */
 
@@ -1008,14 +1007,14 @@ temp_auto(1);
 temp_auto(2);
 temp_auto(3);
 
-int lm85_attach_adapter(struct i2c_adapter *adapter)
+static int lm85_attach_adapter(struct i2c_adapter *adapter)
 {
        if (!(adapter->class & I2C_CLASS_HWMON))
                return 0;
        return i2c_probe(adapter, &addr_data, lm85_detect);
 }
 
-int lm85_detect(struct i2c_adapter *adapter, int address,
+static int lm85_detect(struct i2c_adapter *adapter, int address,
                int kind)
 {
        int company, verstep ;
@@ -1034,11 +1033,10 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
           client structure, even though we cannot fill it completely yet.
           But it allows us to access lm85_{read,write}_value. */
 
-       if (!(data = kmalloc(sizeof(struct lm85_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct lm85_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto ERROR0;
        }
-       memset(data, 0, sizeof(struct lm85_data));
 
        new_client = &data->client;
        i2c_set_clientdata(new_client, data);
@@ -1148,7 +1146,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
                goto ERROR1;
 
        /* Set the VRM version */
-       data->vrm = i2c_which_vrm();
+       data->vrm = vid_which_vrm();
 
        /* Initialize the LM85 chip */
        lm85_init_client(new_client);
@@ -1237,7 +1235,7 @@ int lm85_detect(struct i2c_adapter *adapter, int address,
        return err;
 }
 
-int lm85_detach_client(struct i2c_client *client)
+static int lm85_detach_client(struct i2c_client *client)
 {
        struct lm85_data *data = i2c_get_clientdata(client);
        hwmon_device_unregister(data->class_dev);
@@ -1247,7 +1245,7 @@ int lm85_detach_client(struct i2c_client *client)
 }
 
 
-int lm85_read_value(struct i2c_client *client, u8 reg)
+static int lm85_read_value(struct i2c_client *client, u8 reg)
 {
        int res;
 
@@ -1277,7 +1275,7 @@ int lm85_read_value(struct i2c_client *client, u8 reg)
        return res ;
 }
 
-int lm85_write_value(struct i2c_client *client, u8 reg, int value)
+static int lm85_write_value(struct i2c_client *client, u8 reg, int value)
 {
        int res ;
 
@@ -1306,7 +1304,7 @@ int lm85_write_value(struct i2c_client *client, u8 reg, int value)
        return res ;
 }
 
-void lm85_init_client(struct i2c_client *client)
+static void lm85_init_client(struct i2c_client *client)
 {
        int value;
        struct lm85_data *data = i2c_get_clientdata(client);