vserver 1.9.5.x5
[linux-2.6.git] / drivers / i2c / chips / lm80.c
index fe78d98..c13d515 100644 (file)
 #include <linux/i2c-sensor.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { 0x28, 0x2f, I2C_CLIENT_END };
+static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c,
+                                       0x2d, 0x2e, 0x2f, I2C_CLIENT_END };
 static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
-static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
 SENSORS_INSMOD_1(lm80);
@@ -145,7 +144,7 @@ static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value);
  * Internal variables
  */
 
-static int lm80_id = 0;
+static int lm80_id;
 
 /*
  * Driver data (common to all clients)
@@ -262,14 +261,15 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
 {
        struct i2c_client *client = to_i2c_client(dev);
        struct lm80_data *data = i2c_get_clientdata(client);
-       unsigned long min;
+       unsigned long min, val;
        u8 reg;
 
        /* Save fan_min */
        min = FAN_FROM_REG(data->fan_min[nr],
                           DIV_FROM_REG(data->fan_div[nr]));
 
-       data->fan_div[nr] = DIV_TO_REG(simple_strtoul(buf, NULL, 10));
+       val = simple_strtoul(buf, NULL, 10);
+       data->fan_div[nr] = DIV_TO_REG(val);
 
        reg = (lm80_read_value(client, LM80_REG_FANDIV) & ~(3 << (2 * (nr + 1))))
            | (data->fan_div[nr] << (2 * (nr + 1)));