This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / i2c / chips / adm1025.c
index 4f41088..711eaa2 100644 (file)
  * NE1619 has two possible addresses: 0x2c and 0x2d.
  */
 
-static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
+static unsigned short normal_i2c[] = { I2C_CLIENT_END };
+static unsigned short normal_i2c_range[] = { 0x2c, 0x2e, I2C_CLIENT_END };
 static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
+static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /*
  * Insmod parameters
@@ -151,7 +153,7 @@ struct adm1025_data {
  * Internal variables
  */
 
-static int adm1025_id;
+static int adm1025_id = 0;
 
 /*
  * Sysfs stuff
@@ -210,8 +212,8 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
 { \
        struct i2c_client *client = to_i2c_client(dev); \
        struct adm1025_data *data = i2c_get_clientdata(client); \
-       long val = simple_strtol(buf, NULL, 10); \
-       data->in_min[offset] = IN_TO_REG(val, in_scale[offset]); \
+       data->in_min[offset] = IN_TO_REG(simple_strtol(buf, NULL, 10), \
+                              in_scale[offset]); \
        i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MIN(offset), \
                                  data->in_min[offset]); \
        return count; \
@@ -221,8 +223,8 @@ static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \
 { \
        struct i2c_client *client = to_i2c_client(dev); \
        struct adm1025_data *data = i2c_get_clientdata(client); \
-       long val = simple_strtol(buf, NULL, 10); \
-       data->in_max[offset] = IN_TO_REG(val, in_scale[offset]); \
+       data->in_max[offset] = IN_TO_REG(simple_strtol(buf, NULL, 10), \
+                              in_scale[offset]); \
        i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MAX(offset), \
                                  data->in_max[offset]); \
        return count; \
@@ -244,8 +246,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
 { \
        struct i2c_client *client = to_i2c_client(dev); \
        struct adm1025_data *data = i2c_get_clientdata(client); \
-       long val = simple_strtol(buf, NULL, 10); \
-       data->temp_min[offset-1] = TEMP_TO_REG(val); \
+       data->temp_min[offset-1] = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
        i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_LOW(offset-1), \
                                  data->temp_min[offset-1]); \
        return count; \
@@ -255,8 +256,7 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
 { \
        struct i2c_client *client = to_i2c_client(dev); \
        struct adm1025_data *data = i2c_get_clientdata(client); \
-       long val = simple_strtol(buf, NULL, 10); \
-       data->temp_max[offset-1] = TEMP_TO_REG(val); \
+       data->temp_max[offset-1] = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
        i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_HIGH(offset-1), \
                                  data->temp_max[offset-1]); \
        return count; \