X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fi2c%2Fchips%2Fgl518sm.c;h=3481ddbf004408d7854519fe2351ec75cf91e650;hb=9e1bf581d67d87a1d7fc0ea500729e3a03643a26;hp=c4e914ba2a3be086bbfdbb2f185ef40d90780eb5;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/drivers/i2c/chips/gl518sm.c b/drivers/i2c/chips/gl518sm.c index c4e914ba2..3481ddbf0 100644 --- a/drivers/i2c/chips/gl518sm.c +++ b/drivers/i2c/chips/gl518sm.c @@ -45,7 +45,9 @@ /* Addresses to scan */ static unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { 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_2(gl518sm_r00, gl518sm_r80); @@ -162,7 +164,7 @@ static struct i2c_driver gl518_driver = { * Internal variables */ -static int gl518_id; +static int gl518_id = 0; /* * Sysfs stuff @@ -215,8 +217,7 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \ { \ struct i2c_client *client = to_i2c_client(dev); \ struct gl518_data *data = i2c_get_clientdata(client); \ - long val = simple_strtol(buf, NULL, 10); \ - data->value = type##_TO_REG(val); \ + data->value = type##_TO_REG(simple_strtol(buf, NULL, 10)); \ gl518_write_value(client, reg, data->value); \ return count; \ } @@ -228,8 +229,7 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \ struct i2c_client *client = to_i2c_client(dev); \ struct gl518_data *data = i2c_get_clientdata(client); \ int regvalue = gl518_read_value(client, reg); \ - unsigned long val = simple_strtoul(buf, NULL, 10); \ - data->value = type##_TO_REG(val); \ + data->value = type##_TO_REG(simple_strtoul(buf, NULL, 10)); \ regvalue = (regvalue & ~mask) | (data->value << shift); \ gl518_write_value(client, reg, regvalue); \ return count; \