diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/tmp421.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index 65095feadc0f..bb9760d7e8b6 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c | |||
@@ -61,9 +61,9 @@ static const u8 TMP421_TEMP_LSB[4] = { 0x10, 0x11, 0x12, 0x13 }; | |||
61 | #define TMP423_DEVICE_ID 0x23 | 61 | #define TMP423_DEVICE_ID 0x23 |
62 | 62 | ||
63 | static const struct i2c_device_id tmp421_id[] = { | 63 | static const struct i2c_device_id tmp421_id[] = { |
64 | { "tmp421", tmp421 }, | 64 | { "tmp421", 2 }, |
65 | { "tmp422", tmp422 }, | 65 | { "tmp422", 3 }, |
66 | { "tmp423", tmp423 }, | 66 | { "tmp423", 4 }, |
67 | { } | 67 | { } |
68 | }; | 68 | }; |
69 | MODULE_DEVICE_TABLE(i2c, tmp421_id); | 69 | MODULE_DEVICE_TABLE(i2c, tmp421_id); |
@@ -73,7 +73,7 @@ struct tmp421_data { | |||
73 | struct mutex update_lock; | 73 | struct mutex update_lock; |
74 | char valid; | 74 | char valid; |
75 | unsigned long last_updated; | 75 | unsigned long last_updated; |
76 | int kind; | 76 | int channels; |
77 | u8 config; | 77 | u8 config; |
78 | s16 temp[4]; | 78 | s16 temp[4]; |
79 | }; | 79 | }; |
@@ -109,7 +109,7 @@ static struct tmp421_data *tmp421_update_device(struct device *dev) | |||
109 | data->config = i2c_smbus_read_byte_data(client, | 109 | data->config = i2c_smbus_read_byte_data(client, |
110 | TMP421_CONFIG_REG_1); | 110 | TMP421_CONFIG_REG_1); |
111 | 111 | ||
112 | for (i = 0; i <= data->kind; i++) { | 112 | for (i = 0; i < data->channels; i++) { |
113 | data->temp[i] = i2c_smbus_read_byte_data(client, | 113 | data->temp[i] = i2c_smbus_read_byte_data(client, |
114 | TMP421_TEMP_MSB[i]) << 8; | 114 | TMP421_TEMP_MSB[i]) << 8; |
115 | data->temp[i] |= i2c_smbus_read_byte_data(client, | 115 | data->temp[i] |= i2c_smbus_read_byte_data(client, |
@@ -168,7 +168,7 @@ static mode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a, | |||
168 | devattr = container_of(a, struct device_attribute, attr); | 168 | devattr = container_of(a, struct device_attribute, attr); |
169 | index = to_sensor_dev_attr(devattr)->index; | 169 | index = to_sensor_dev_attr(devattr)->index; |
170 | 170 | ||
171 | if (data->kind > index) | 171 | if (index < data->channels) |
172 | return a->mode; | 172 | return a->mode; |
173 | 173 | ||
174 | return 0; | 174 | return 0; |
@@ -273,7 +273,7 @@ static int tmp421_probe(struct i2c_client *client, | |||
273 | 273 | ||
274 | i2c_set_clientdata(client, data); | 274 | i2c_set_clientdata(client, data); |
275 | mutex_init(&data->update_lock); | 275 | mutex_init(&data->update_lock); |
276 | data->kind = id->driver_data; | 276 | data->channels = id->driver_data; |
277 | 277 | ||
278 | err = tmp421_init_client(client); | 278 | err = tmp421_init_client(client); |
279 | if (err) | 279 | if (err) |