diff options
Diffstat (limited to 'drivers/i2c/chips/lm87.c')
| -rw-r--r-- | drivers/i2c/chips/lm87.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/i2c/chips/lm87.c b/drivers/i2c/chips/lm87.c index 98cabd665063..4372b61a0882 100644 --- a/drivers/i2c/chips/lm87.c +++ b/drivers/i2c/chips/lm87.c | |||
| @@ -218,19 +218,19 @@ static inline int lm87_write_value(struct i2c_client *client, u8 reg, u8 value) | |||
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | #define show_in(offset) \ | 220 | #define show_in(offset) \ |
| 221 | static ssize_t show_in##offset##_input(struct device *dev, char *buf) \ | 221 | static ssize_t show_in##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 222 | { \ | 222 | { \ |
| 223 | struct lm87_data *data = lm87_update_device(dev); \ | 223 | struct lm87_data *data = lm87_update_device(dev); \ |
| 224 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ | 224 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ |
| 225 | data->in_scale[offset])); \ | 225 | data->in_scale[offset])); \ |
| 226 | } \ | 226 | } \ |
| 227 | static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ | 227 | static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 228 | { \ | 228 | { \ |
| 229 | struct lm87_data *data = lm87_update_device(dev); \ | 229 | struct lm87_data *data = lm87_update_device(dev); \ |
| 230 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ | 230 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ |
| 231 | data->in_scale[offset])); \ | 231 | data->in_scale[offset])); \ |
| 232 | } \ | 232 | } \ |
| 233 | static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ | 233 | static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 234 | { \ | 234 | { \ |
| 235 | struct lm87_data *data = lm87_update_device(dev); \ | 235 | struct lm87_data *data = lm87_update_device(dev); \ |
| 236 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ | 236 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ |
| @@ -274,13 +274,13 @@ static void set_in_max(struct device *dev, const char *buf, int nr) | |||
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | #define set_in(offset) \ | 276 | #define set_in(offset) \ |
| 277 | static ssize_t set_in##offset##_min(struct device *dev, \ | 277 | static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, \ |
| 278 | const char *buf, size_t count) \ | 278 | const char *buf, size_t count) \ |
| 279 | { \ | 279 | { \ |
| 280 | set_in_min(dev, buf, offset); \ | 280 | set_in_min(dev, buf, offset); \ |
| 281 | return count; \ | 281 | return count; \ |
| 282 | } \ | 282 | } \ |
| 283 | static ssize_t set_in##offset##_max(struct device *dev, \ | 283 | static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, \ |
| 284 | const char *buf, size_t count) \ | 284 | const char *buf, size_t count) \ |
| 285 | { \ | 285 | { \ |
| 286 | set_in_max(dev, buf, offset); \ | 286 | set_in_max(dev, buf, offset); \ |
| @@ -300,17 +300,17 @@ set_in(6); | |||
| 300 | set_in(7); | 300 | set_in(7); |
| 301 | 301 | ||
| 302 | #define show_temp(offset) \ | 302 | #define show_temp(offset) \ |
| 303 | static ssize_t show_temp##offset##_input(struct device *dev, char *buf) \ | 303 | static ssize_t show_temp##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 304 | { \ | 304 | { \ |
| 305 | struct lm87_data *data = lm87_update_device(dev); \ | 305 | struct lm87_data *data = lm87_update_device(dev); \ |
| 306 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ | 306 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ |
| 307 | } \ | 307 | } \ |
| 308 | static ssize_t show_temp##offset##_low(struct device *dev, char *buf) \ | 308 | static ssize_t show_temp##offset##_low(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 309 | { \ | 309 | { \ |
| 310 | struct lm87_data *data = lm87_update_device(dev); \ | 310 | struct lm87_data *data = lm87_update_device(dev); \ |
| 311 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \ | 311 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[offset-1])); \ |
| 312 | } \ | 312 | } \ |
| 313 | static ssize_t show_temp##offset##_high(struct device *dev, char *buf) \ | 313 | static ssize_t show_temp##offset##_high(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 314 | { \ | 314 | { \ |
| 315 | struct lm87_data *data = lm87_update_device(dev); \ | 315 | struct lm87_data *data = lm87_update_device(dev); \ |
| 316 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \ | 316 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[offset-1])); \ |
| @@ -346,13 +346,13 @@ static void set_temp_high(struct device *dev, const char *buf, int nr) | |||
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | #define set_temp(offset) \ | 348 | #define set_temp(offset) \ |
| 349 | static ssize_t set_temp##offset##_low(struct device *dev, \ | 349 | static ssize_t set_temp##offset##_low(struct device *dev, struct device_attribute *attr, \ |
| 350 | const char *buf, size_t count) \ | 350 | const char *buf, size_t count) \ |
| 351 | { \ | 351 | { \ |
| 352 | set_temp_low(dev, buf, offset-1); \ | 352 | set_temp_low(dev, buf, offset-1); \ |
| 353 | return count; \ | 353 | return count; \ |
| 354 | } \ | 354 | } \ |
| 355 | static ssize_t set_temp##offset##_high(struct device *dev, \ | 355 | static ssize_t set_temp##offset##_high(struct device *dev, struct device_attribute *attr, \ |
| 356 | const char *buf, size_t count) \ | 356 | const char *buf, size_t count) \ |
| 357 | { \ | 357 | { \ |
| 358 | set_temp_high(dev, buf, offset-1); \ | 358 | set_temp_high(dev, buf, offset-1); \ |
| @@ -366,13 +366,13 @@ set_temp(1); | |||
| 366 | set_temp(2); | 366 | set_temp(2); |
| 367 | set_temp(3); | 367 | set_temp(3); |
| 368 | 368 | ||
| 369 | static ssize_t show_temp_crit_int(struct device *dev, char *buf) | 369 | static ssize_t show_temp_crit_int(struct device *dev, struct device_attribute *attr, char *buf) |
| 370 | { | 370 | { |
| 371 | struct lm87_data *data = lm87_update_device(dev); | 371 | struct lm87_data *data = lm87_update_device(dev); |
| 372 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int)); | 372 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_int)); |
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | static ssize_t show_temp_crit_ext(struct device *dev, char *buf) | 375 | static ssize_t show_temp_crit_ext(struct device *dev, struct device_attribute *attr, char *buf) |
| 376 | { | 376 | { |
| 377 | struct lm87_data *data = lm87_update_device(dev); | 377 | struct lm87_data *data = lm87_update_device(dev); |
| 378 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext)); | 378 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit_ext)); |
| @@ -383,19 +383,19 @@ static DEVICE_ATTR(temp2_crit, S_IRUGO, show_temp_crit_ext, NULL); | |||
| 383 | static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); | 383 | static DEVICE_ATTR(temp3_crit, S_IRUGO, show_temp_crit_ext, NULL); |
| 384 | 384 | ||
| 385 | #define show_fan(offset) \ | 385 | #define show_fan(offset) \ |
| 386 | static ssize_t show_fan##offset##_input(struct device *dev, char *buf) \ | 386 | static ssize_t show_fan##offset##_input(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 387 | { \ | 387 | { \ |
| 388 | struct lm87_data *data = lm87_update_device(dev); \ | 388 | struct lm87_data *data = lm87_update_device(dev); \ |
| 389 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \ | 389 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[offset-1], \ |
| 390 | FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ | 390 | FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ |
| 391 | } \ | 391 | } \ |
| 392 | static ssize_t show_fan##offset##_min(struct device *dev, char *buf) \ | 392 | static ssize_t show_fan##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 393 | { \ | 393 | { \ |
| 394 | struct lm87_data *data = lm87_update_device(dev); \ | 394 | struct lm87_data *data = lm87_update_device(dev); \ |
| 395 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \ | 395 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[offset-1], \ |
| 396 | FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ | 396 | FAN_DIV_FROM_REG(data->fan_div[offset-1]))); \ |
| 397 | } \ | 397 | } \ |
| 398 | static ssize_t show_fan##offset##_div(struct device *dev, char *buf) \ | 398 | static ssize_t show_fan##offset##_div(struct device *dev, struct device_attribute *attr, char *buf) \ |
| 399 | { \ | 399 | { \ |
| 400 | struct lm87_data *data = lm87_update_device(dev); \ | 400 | struct lm87_data *data = lm87_update_device(dev); \ |
| 401 | return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \ | 401 | return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[offset-1])); \ |
| @@ -465,13 +465,13 @@ static ssize_t set_fan_div(struct device *dev, const char *buf, | |||
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | #define set_fan(offset) \ | 467 | #define set_fan(offset) \ |
| 468 | static ssize_t set_fan##offset##_min(struct device *dev, const char *buf, \ | 468 | static ssize_t set_fan##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
| 469 | size_t count) \ | 469 | size_t count) \ |
| 470 | { \ | 470 | { \ |
| 471 | set_fan_min(dev, buf, offset-1); \ | 471 | set_fan_min(dev, buf, offset-1); \ |
| 472 | return count; \ | 472 | return count; \ |
| 473 | } \ | 473 | } \ |
| 474 | static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \ | 474 | static ssize_t set_fan##offset##_div(struct device *dev, struct device_attribute *attr, const char *buf, \ |
| 475 | size_t count) \ | 475 | size_t count) \ |
| 476 | { \ | 476 | { \ |
| 477 | return set_fan_div(dev, buf, count, offset-1); \ | 477 | return set_fan_div(dev, buf, count, offset-1); \ |
| @@ -483,26 +483,26 @@ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ | |||
| 483 | set_fan(1); | 483 | set_fan(1); |
| 484 | set_fan(2); | 484 | set_fan(2); |
| 485 | 485 | ||
| 486 | static ssize_t show_alarms(struct device *dev, char *buf) | 486 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
| 487 | { | 487 | { |
| 488 | struct lm87_data *data = lm87_update_device(dev); | 488 | struct lm87_data *data = lm87_update_device(dev); |
| 489 | return sprintf(buf, "%d\n", data->alarms); | 489 | return sprintf(buf, "%d\n", data->alarms); |
| 490 | } | 490 | } |
| 491 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 491 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
| 492 | 492 | ||
| 493 | static ssize_t show_vid(struct device *dev, char *buf) | 493 | static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) |
| 494 | { | 494 | { |
| 495 | struct lm87_data *data = lm87_update_device(dev); | 495 | struct lm87_data *data = lm87_update_device(dev); |
| 496 | return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); | 496 | return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); |
| 497 | } | 497 | } |
| 498 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); | 498 | static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); |
| 499 | 499 | ||
| 500 | static ssize_t show_vrm(struct device *dev, char *buf) | 500 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) |
| 501 | { | 501 | { |
| 502 | struct lm87_data *data = lm87_update_device(dev); | 502 | struct lm87_data *data = lm87_update_device(dev); |
| 503 | return sprintf(buf, "%d\n", data->vrm); | 503 | return sprintf(buf, "%d\n", data->vrm); |
| 504 | } | 504 | } |
| 505 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 505 | static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
| 506 | { | 506 | { |
| 507 | struct i2c_client *client = to_i2c_client(dev); | 507 | struct i2c_client *client = to_i2c_client(dev); |
| 508 | struct lm87_data *data = i2c_get_clientdata(client); | 508 | struct lm87_data *data = i2c_get_clientdata(client); |
| @@ -511,12 +511,12 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | |||
| 511 | } | 511 | } |
| 512 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); | 512 | static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); |
| 513 | 513 | ||
| 514 | static ssize_t show_aout(struct device *dev, char *buf) | 514 | static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf) |
| 515 | { | 515 | { |
| 516 | struct lm87_data *data = lm87_update_device(dev); | 516 | struct lm87_data *data = lm87_update_device(dev); |
| 517 | return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); | 517 | return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout)); |
| 518 | } | 518 | } |
| 519 | static ssize_t set_aout(struct device *dev, const char *buf, size_t count) | 519 | static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
| 520 | { | 520 | { |
| 521 | struct i2c_client *client = to_i2c_client(dev); | 521 | struct i2c_client *client = to_i2c_client(dev); |
| 522 | struct lm87_data *data = i2c_get_clientdata(client); | 522 | struct lm87_data *data = i2c_get_clientdata(client); |
