hwmon: (adm1031) Get rid of macro-generated wrappers

Use the standard dynamic sysfs callbacks instead of macro-generated
wrappers. It makes the code more simple and the binary smaller (-8% on
my system.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Jean Delvare and committed by
Mark M. Hoffman
c801082d 6d6006b8

+129 -190
+129 -190
drivers/hwmon/adm1031.c
··· 27 27 #include <linux/jiffies.h> 28 28 #include <linux/i2c.h> 29 29 #include <linux/hwmon.h> 30 + #include <linux/hwmon-sysfs.h> 30 31 #include <linux/err.h> 31 32 #include <linux/mutex.h> 32 33 ··· 246 245 return 0; 247 246 } 248 247 249 - static ssize_t show_fan_auto_channel(struct device *dev, char *buf, int nr) 248 + static ssize_t show_fan_auto_channel(struct device *dev, 249 + struct device_attribute *attr, char *buf) 250 250 { 251 + int nr = to_sensor_dev_attr(attr)->index; 251 252 struct adm1031_data *data = adm1031_update_device(dev); 252 253 return sprintf(buf, "%d\n", GET_FAN_AUTO_BITFIELD(data, nr)); 253 254 } 254 255 255 256 static ssize_t 256 - set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr) 257 + set_fan_auto_channel(struct device *dev, struct device_attribute *attr, 258 + const char *buf, size_t count) 257 259 { 258 260 struct i2c_client *client = to_i2c_client(dev); 259 261 struct adm1031_data *data = i2c_get_clientdata(client); 262 + int nr = to_sensor_dev_attr(attr)->index; 260 263 int val = simple_strtol(buf, NULL, 10); 261 264 u8 reg; 262 265 int ret; ··· 299 294 return count; 300 295 } 301 296 302 - #define fan_auto_channel_offset(offset) \ 303 - static ssize_t show_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 304 - { \ 305 - return show_fan_auto_channel(dev, buf, offset - 1); \ 306 - } \ 307 - static ssize_t set_fan_auto_channel_##offset (struct device *dev, struct device_attribute *attr, \ 308 - const char *buf, size_t count) \ 309 - { \ 310 - return set_fan_auto_channel(dev, buf, count, offset - 1); \ 311 - } \ 312 - static DEVICE_ATTR(auto_fan##offset##_channel, S_IRUGO | S_IWUSR, \ 313 - show_fan_auto_channel_##offset, \ 314 - set_fan_auto_channel_##offset) 315 - 316 - fan_auto_channel_offset(1); 317 - fan_auto_channel_offset(2); 297 + static SENSOR_DEVICE_ATTR(auto_fan1_channel, S_IRUGO | S_IWUSR, 298 + show_fan_auto_channel, set_fan_auto_channel, 0); 299 + static SENSOR_DEVICE_ATTR(auto_fan2_channel, S_IRUGO | S_IWUSR, 300 + show_fan_auto_channel, set_fan_auto_channel, 1); 318 301 319 302 /* Auto Temps */ 320 - static ssize_t show_auto_temp_off(struct device *dev, char *buf, int nr) 303 + static ssize_t show_auto_temp_off(struct device *dev, 304 + struct device_attribute *attr, char *buf) 321 305 { 306 + int nr = to_sensor_dev_attr(attr)->index; 322 307 struct adm1031_data *data = adm1031_update_device(dev); 323 308 return sprintf(buf, "%d\n", 324 309 AUTO_TEMP_OFF_FROM_REG(data->auto_temp[nr])); 325 310 } 326 - static ssize_t show_auto_temp_min(struct device *dev, char *buf, int nr) 311 + static ssize_t show_auto_temp_min(struct device *dev, 312 + struct device_attribute *attr, char *buf) 327 313 { 314 + int nr = to_sensor_dev_attr(attr)->index; 328 315 struct adm1031_data *data = adm1031_update_device(dev); 329 316 return sprintf(buf, "%d\n", 330 317 AUTO_TEMP_MIN_FROM_REG(data->auto_temp[nr])); 331 318 } 332 319 static ssize_t 333 - set_auto_temp_min(struct device *dev, const char *buf, size_t count, int nr) 320 + set_auto_temp_min(struct device *dev, struct device_attribute *attr, 321 + const char *buf, size_t count) 334 322 { 335 323 struct i2c_client *client = to_i2c_client(dev); 336 324 struct adm1031_data *data = i2c_get_clientdata(client); 325 + int nr = to_sensor_dev_attr(attr)->index; 337 326 int val = simple_strtol(buf, NULL, 10); 338 327 339 328 mutex_lock(&data->update_lock); ··· 337 338 mutex_unlock(&data->update_lock); 338 339 return count; 339 340 } 340 - static ssize_t show_auto_temp_max(struct device *dev, char *buf, int nr) 341 + static ssize_t show_auto_temp_max(struct device *dev, 342 + struct device_attribute *attr, char *buf) 341 343 { 344 + int nr = to_sensor_dev_attr(attr)->index; 342 345 struct adm1031_data *data = adm1031_update_device(dev); 343 346 return sprintf(buf, "%d\n", 344 347 AUTO_TEMP_MAX_FROM_REG(data->auto_temp[nr])); 345 348 } 346 349 static ssize_t 347 - set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr) 350 + set_auto_temp_max(struct device *dev, struct device_attribute *attr, 351 + const char *buf, size_t count) 348 352 { 349 353 struct i2c_client *client = to_i2c_client(dev); 350 354 struct adm1031_data *data = i2c_get_clientdata(client); 355 + int nr = to_sensor_dev_attr(attr)->index; 351 356 int val = simple_strtol(buf, NULL, 10); 352 357 353 358 mutex_lock(&data->update_lock); ··· 362 359 return count; 363 360 } 364 361 365 - #define auto_temp_reg(offset) \ 366 - static ssize_t show_auto_temp_##offset##_off (struct device *dev, struct device_attribute *attr, char *buf) \ 367 - { \ 368 - return show_auto_temp_off(dev, buf, offset - 1); \ 369 - } \ 370 - static ssize_t show_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ 371 - { \ 372 - return show_auto_temp_min(dev, buf, offset - 1); \ 373 - } \ 374 - static ssize_t show_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ 375 - { \ 376 - return show_auto_temp_max(dev, buf, offset - 1); \ 377 - } \ 378 - static ssize_t set_auto_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \ 379 - const char *buf, size_t count) \ 380 - { \ 381 - return set_auto_temp_min(dev, buf, count, offset - 1); \ 382 - } \ 383 - static ssize_t set_auto_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \ 384 - const char *buf, size_t count) \ 385 - { \ 386 - return set_auto_temp_max(dev, buf, count, offset - 1); \ 387 - } \ 388 - static DEVICE_ATTR(auto_temp##offset##_off, S_IRUGO, \ 389 - show_auto_temp_##offset##_off, NULL); \ 390 - static DEVICE_ATTR(auto_temp##offset##_min, S_IRUGO | S_IWUSR, \ 391 - show_auto_temp_##offset##_min, set_auto_temp_##offset##_min);\ 392 - static DEVICE_ATTR(auto_temp##offset##_max, S_IRUGO | S_IWUSR, \ 393 - show_auto_temp_##offset##_max, set_auto_temp_##offset##_max) 362 + #define auto_temp_reg(offset) \ 363 + static SENSOR_DEVICE_ATTR(auto_temp##offset##_off, S_IRUGO, \ 364 + show_auto_temp_off, NULL, offset - 1); \ 365 + static SENSOR_DEVICE_ATTR(auto_temp##offset##_min, S_IRUGO | S_IWUSR, \ 366 + show_auto_temp_min, set_auto_temp_min, offset - 1); \ 367 + static SENSOR_DEVICE_ATTR(auto_temp##offset##_max, S_IRUGO | S_IWUSR, \ 368 + show_auto_temp_max, set_auto_temp_max, offset - 1) 394 369 395 370 auto_temp_reg(1); 396 371 auto_temp_reg(2); 397 372 auto_temp_reg(3); 398 373 399 374 /* pwm */ 400 - static ssize_t show_pwm(struct device *dev, char *buf, int nr) 375 + static ssize_t show_pwm(struct device *dev, 376 + struct device_attribute *attr, char *buf) 401 377 { 378 + int nr = to_sensor_dev_attr(attr)->index; 402 379 struct adm1031_data *data = adm1031_update_device(dev); 403 380 return sprintf(buf, "%d\n", PWM_FROM_REG(data->pwm[nr])); 404 381 } 405 - static ssize_t 406 - set_pwm(struct device *dev, const char *buf, size_t count, int nr) 382 + static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, 383 + const char *buf, size_t count) 407 384 { 408 385 struct i2c_client *client = to_i2c_client(dev); 409 386 struct adm1031_data *data = i2c_get_clientdata(client); 387 + int nr = to_sensor_dev_attr(attr)->index; 410 388 int val = simple_strtol(buf, NULL, 10); 411 389 int reg; 412 390 ··· 407 423 return count; 408 424 } 409 425 410 - #define pwm_reg(offset) \ 411 - static ssize_t show_pwm_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 412 - { \ 413 - return show_pwm(dev, buf, offset - 1); \ 414 - } \ 415 - static ssize_t set_pwm_##offset (struct device *dev, struct device_attribute *attr, \ 416 - const char *buf, size_t count) \ 417 - { \ 418 - return set_pwm(dev, buf, count, offset - 1); \ 419 - } \ 420 - static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ 421 - show_pwm_##offset, set_pwm_##offset) 422 - 423 - pwm_reg(1); 424 - pwm_reg(2); 426 + static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 0); 427 + static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 1); 428 + static SENSOR_DEVICE_ATTR(auto_fan1_min_pwm, S_IRUGO | S_IWUSR, 429 + show_pwm, set_pwm, 0); 430 + static SENSOR_DEVICE_ATTR(auto_fan2_min_pwm, S_IRUGO | S_IWUSR, 431 + show_pwm, set_pwm, 1); 425 432 426 433 /* Fans */ 427 434 ··· 459 484 } 460 485 461 486 462 - static ssize_t show_fan(struct device *dev, char *buf, int nr) 487 + static ssize_t show_fan(struct device *dev, 488 + struct device_attribute *attr, char *buf) 463 489 { 490 + int nr = to_sensor_dev_attr(attr)->index; 464 491 struct adm1031_data *data = adm1031_update_device(dev); 465 492 int value; 466 493 ··· 471 494 return sprintf(buf, "%d\n", value); 472 495 } 473 496 474 - static ssize_t show_fan_div(struct device *dev, char *buf, int nr) 497 + static ssize_t show_fan_div(struct device *dev, 498 + struct device_attribute *attr, char *buf) 475 499 { 500 + int nr = to_sensor_dev_attr(attr)->index; 476 501 struct adm1031_data *data = adm1031_update_device(dev); 477 502 return sprintf(buf, "%d\n", FAN_DIV_FROM_REG(data->fan_div[nr])); 478 503 } 479 - static ssize_t show_fan_min(struct device *dev, char *buf, int nr) 504 + static ssize_t show_fan_min(struct device *dev, 505 + struct device_attribute *attr, char *buf) 480 506 { 507 + int nr = to_sensor_dev_attr(attr)->index; 481 508 struct adm1031_data *data = adm1031_update_device(dev); 482 509 return sprintf(buf, "%d\n", 483 510 FAN_FROM_REG(data->fan_min[nr], 484 511 FAN_DIV_FROM_REG(data->fan_div[nr]))); 485 512 } 486 - static ssize_t 487 - set_fan_min(struct device *dev, const char *buf, size_t count, int nr) 513 + static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, 514 + const char *buf, size_t count) 488 515 { 489 516 struct i2c_client *client = to_i2c_client(dev); 490 517 struct adm1031_data *data = i2c_get_clientdata(client); 518 + int nr = to_sensor_dev_attr(attr)->index; 491 519 int val = simple_strtol(buf, NULL, 10); 492 520 493 521 mutex_lock(&data->update_lock); ··· 506 524 mutex_unlock(&data->update_lock); 507 525 return count; 508 526 } 509 - static ssize_t 510 - set_fan_div(struct device *dev, const char *buf, size_t count, int nr) 527 + static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, 528 + const char *buf, size_t count) 511 529 { 512 530 struct i2c_client *client = to_i2c_client(dev); 513 531 struct adm1031_data *data = i2c_get_clientdata(client); 532 + int nr = to_sensor_dev_attr(attr)->index; 514 533 int val = simple_strtol(buf, NULL, 10); 515 534 u8 tmp; 516 535 int old_div; ··· 550 567 } 551 568 552 569 #define fan_offset(offset) \ 553 - static ssize_t show_fan_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 554 - { \ 555 - return show_fan(dev, buf, offset - 1); \ 556 - } \ 557 - static ssize_t show_fan_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ 558 - { \ 559 - return show_fan_min(dev, buf, offset - 1); \ 560 - } \ 561 - static ssize_t show_fan_##offset##_div (struct device *dev, struct device_attribute *attr, char *buf) \ 562 - { \ 563 - return show_fan_div(dev, buf, offset - 1); \ 564 - } \ 565 - static ssize_t set_fan_##offset##_min (struct device *dev, struct device_attribute *attr, \ 566 - const char *buf, size_t count) \ 567 - { \ 568 - return set_fan_min(dev, buf, count, offset - 1); \ 569 - } \ 570 - static ssize_t set_fan_##offset##_div (struct device *dev, struct device_attribute *attr, \ 571 - const char *buf, size_t count) \ 572 - { \ 573 - return set_fan_div(dev, buf, count, offset - 1); \ 574 - } \ 575 - static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, \ 576 - NULL); \ 577 - static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ 578 - show_fan_##offset##_min, set_fan_##offset##_min); \ 579 - static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ 580 - show_fan_##offset##_div, set_fan_##offset##_div); \ 581 - static DEVICE_ATTR(auto_fan##offset##_min_pwm, S_IRUGO | S_IWUSR, \ 582 - show_pwm_##offset, set_pwm_##offset) 570 + static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \ 571 + show_fan, NULL, offset - 1); \ 572 + static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ 573 + show_fan_min, set_fan_min, offset - 1); \ 574 + static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ 575 + show_fan_div, set_fan_div, offset - 1) 583 576 584 577 fan_offset(1); 585 578 fan_offset(2); 586 579 587 580 588 581 /* Temps */ 589 - static ssize_t show_temp(struct device *dev, char *buf, int nr) 582 + static ssize_t show_temp(struct device *dev, 583 + struct device_attribute *attr, char *buf) 590 584 { 585 + int nr = to_sensor_dev_attr(attr)->index; 591 586 struct adm1031_data *data = adm1031_update_device(dev); 592 587 int ext; 593 588 ext = nr == 0 ? ··· 573 612 (((data->ext_temp[nr] >> ((nr - 1) * 3)) & 7)); 574 613 return sprintf(buf, "%d\n", TEMP_FROM_REG_EXT(data->temp[nr], ext)); 575 614 } 576 - static ssize_t show_temp_min(struct device *dev, char *buf, int nr) 615 + static ssize_t show_temp_min(struct device *dev, 616 + struct device_attribute *attr, char *buf) 577 617 { 618 + int nr = to_sensor_dev_attr(attr)->index; 578 619 struct adm1031_data *data = adm1031_update_device(dev); 579 620 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[nr])); 580 621 } 581 - static ssize_t show_temp_max(struct device *dev, char *buf, int nr) 622 + static ssize_t show_temp_max(struct device *dev, 623 + struct device_attribute *attr, char *buf) 582 624 { 625 + int nr = to_sensor_dev_attr(attr)->index; 583 626 struct adm1031_data *data = adm1031_update_device(dev); 584 627 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[nr])); 585 628 } 586 - static ssize_t show_temp_crit(struct device *dev, char *buf, int nr) 629 + static ssize_t show_temp_crit(struct device *dev, 630 + struct device_attribute *attr, char *buf) 587 631 { 632 + int nr = to_sensor_dev_attr(attr)->index; 588 633 struct adm1031_data *data = adm1031_update_device(dev); 589 634 return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_crit[nr])); 590 635 } 591 - static ssize_t 592 - set_temp_min(struct device *dev, const char *buf, size_t count, int nr) 636 + static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, 637 + const char *buf, size_t count) 593 638 { 594 639 struct i2c_client *client = to_i2c_client(dev); 595 640 struct adm1031_data *data = i2c_get_clientdata(client); 641 + int nr = to_sensor_dev_attr(attr)->index; 596 642 int val; 597 643 598 644 val = simple_strtol(buf, NULL, 10); ··· 611 643 mutex_unlock(&data->update_lock); 612 644 return count; 613 645 } 614 - static ssize_t 615 - set_temp_max(struct device *dev, const char *buf, size_t count, int nr) 646 + static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, 647 + const char *buf, size_t count) 616 648 { 617 649 struct i2c_client *client = to_i2c_client(dev); 618 650 struct adm1031_data *data = i2c_get_clientdata(client); 651 + int nr = to_sensor_dev_attr(attr)->index; 619 652 int val; 620 653 621 654 val = simple_strtol(buf, NULL, 10); ··· 628 659 mutex_unlock(&data->update_lock); 629 660 return count; 630 661 } 631 - static ssize_t 632 - set_temp_crit(struct device *dev, const char *buf, size_t count, int nr) 662 + static ssize_t set_temp_crit(struct device *dev, struct device_attribute *attr, 663 + const char *buf, size_t count) 633 664 { 634 665 struct i2c_client *client = to_i2c_client(dev); 635 666 struct adm1031_data *data = i2c_get_clientdata(client); 667 + int nr = to_sensor_dev_attr(attr)->index; 636 668 int val; 637 669 638 670 val = simple_strtol(buf, NULL, 10); ··· 646 676 return count; 647 677 } 648 678 649 - #define temp_reg(offset) \ 650 - static ssize_t show_temp_##offset (struct device *dev, struct device_attribute *attr, char *buf) \ 651 - { \ 652 - return show_temp(dev, buf, offset - 1); \ 653 - } \ 654 - static ssize_t show_temp_##offset##_min (struct device *dev, struct device_attribute *attr, char *buf) \ 655 - { \ 656 - return show_temp_min(dev, buf, offset - 1); \ 657 - } \ 658 - static ssize_t show_temp_##offset##_max (struct device *dev, struct device_attribute *attr, char *buf) \ 659 - { \ 660 - return show_temp_max(dev, buf, offset - 1); \ 661 - } \ 662 - static ssize_t show_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, char *buf) \ 663 - { \ 664 - return show_temp_crit(dev, buf, offset - 1); \ 665 - } \ 666 - static ssize_t set_temp_##offset##_min (struct device *dev, struct device_attribute *attr, \ 667 - const char *buf, size_t count) \ 668 - { \ 669 - return set_temp_min(dev, buf, count, offset - 1); \ 670 - } \ 671 - static ssize_t set_temp_##offset##_max (struct device *dev, struct device_attribute *attr, \ 672 - const char *buf, size_t count) \ 673 - { \ 674 - return set_temp_max(dev, buf, count, offset - 1); \ 675 - } \ 676 - static ssize_t set_temp_##offset##_crit (struct device *dev, struct device_attribute *attr, \ 677 - const char *buf, size_t count) \ 678 - { \ 679 - return set_temp_crit(dev, buf, count, offset - 1); \ 680 - } \ 681 - static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, \ 682 - NULL); \ 683 - static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ 684 - show_temp_##offset##_min, set_temp_##offset##_min); \ 685 - static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ 686 - show_temp_##offset##_max, set_temp_##offset##_max); \ 687 - static DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \ 688 - show_temp_##offset##_crit, set_temp_##offset##_crit) 679 + #define temp_reg(offset) \ 680 + static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \ 681 + show_temp, NULL, offset - 1); \ 682 + static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ 683 + show_temp_min, set_temp_min, offset - 1); \ 684 + static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ 685 + show_temp_max, set_temp_max, offset - 1); \ 686 + static SENSOR_DEVICE_ATTR(temp##offset##_crit, S_IRUGO | S_IWUSR, \ 687 + show_temp_crit, set_temp_crit, offset - 1) 689 688 690 689 temp_reg(1); 691 690 temp_reg(2); ··· 678 739 } 679 740 680 741 static struct attribute *adm1031_attributes[] = { 681 - &dev_attr_fan1_input.attr, 682 - &dev_attr_fan1_div.attr, 683 - &dev_attr_fan1_min.attr, 684 - &dev_attr_pwm1.attr, 685 - &dev_attr_auto_fan1_channel.attr, 686 - &dev_attr_temp1_input.attr, 687 - &dev_attr_temp1_min.attr, 688 - &dev_attr_temp1_max.attr, 689 - &dev_attr_temp1_crit.attr, 690 - &dev_attr_temp2_input.attr, 691 - &dev_attr_temp2_min.attr, 692 - &dev_attr_temp2_max.attr, 693 - &dev_attr_temp2_crit.attr, 742 + &sensor_dev_attr_fan1_input.dev_attr.attr, 743 + &sensor_dev_attr_fan1_div.dev_attr.attr, 744 + &sensor_dev_attr_fan1_min.dev_attr.attr, 745 + &sensor_dev_attr_pwm1.dev_attr.attr, 746 + &sensor_dev_attr_auto_fan1_channel.dev_attr.attr, 747 + &sensor_dev_attr_temp1_input.dev_attr.attr, 748 + &sensor_dev_attr_temp1_min.dev_attr.attr, 749 + &sensor_dev_attr_temp1_max.dev_attr.attr, 750 + &sensor_dev_attr_temp1_crit.dev_attr.attr, 751 + &sensor_dev_attr_temp2_input.dev_attr.attr, 752 + &sensor_dev_attr_temp2_min.dev_attr.attr, 753 + &sensor_dev_attr_temp2_max.dev_attr.attr, 754 + &sensor_dev_attr_temp2_crit.dev_attr.attr, 694 755 695 - &dev_attr_auto_temp1_off.attr, 696 - &dev_attr_auto_temp1_min.attr, 697 - &dev_attr_auto_temp1_max.attr, 756 + &sensor_dev_attr_auto_temp1_off.dev_attr.attr, 757 + &sensor_dev_attr_auto_temp1_min.dev_attr.attr, 758 + &sensor_dev_attr_auto_temp1_max.dev_attr.attr, 698 759 699 - &dev_attr_auto_temp2_off.attr, 700 - &dev_attr_auto_temp2_min.attr, 701 - &dev_attr_auto_temp2_max.attr, 760 + &sensor_dev_attr_auto_temp2_off.dev_attr.attr, 761 + &sensor_dev_attr_auto_temp2_min.dev_attr.attr, 762 + &sensor_dev_attr_auto_temp2_max.dev_attr.attr, 702 763 703 - &dev_attr_auto_fan1_min_pwm.attr, 764 + &sensor_dev_attr_auto_fan1_min_pwm.dev_attr.attr, 704 765 705 766 &dev_attr_alarms.attr, 706 767 ··· 712 773 }; 713 774 714 775 static struct attribute *adm1031_attributes_opt[] = { 715 - &dev_attr_fan2_input.attr, 716 - &dev_attr_fan2_div.attr, 717 - &dev_attr_fan2_min.attr, 718 - &dev_attr_pwm2.attr, 719 - &dev_attr_auto_fan2_channel.attr, 720 - &dev_attr_temp3_input.attr, 721 - &dev_attr_temp3_min.attr, 722 - &dev_attr_temp3_max.attr, 723 - &dev_attr_temp3_crit.attr, 724 - &dev_attr_auto_temp3_off.attr, 725 - &dev_attr_auto_temp3_min.attr, 726 - &dev_attr_auto_temp3_max.attr, 727 - &dev_attr_auto_fan2_min_pwm.attr, 776 + &sensor_dev_attr_fan2_input.dev_attr.attr, 777 + &sensor_dev_attr_fan2_div.dev_attr.attr, 778 + &sensor_dev_attr_fan2_min.dev_attr.attr, 779 + &sensor_dev_attr_pwm2.dev_attr.attr, 780 + &sensor_dev_attr_auto_fan2_channel.dev_attr.attr, 781 + &sensor_dev_attr_temp3_input.dev_attr.attr, 782 + &sensor_dev_attr_temp3_min.dev_attr.attr, 783 + &sensor_dev_attr_temp3_max.dev_attr.attr, 784 + &sensor_dev_attr_temp3_crit.dev_attr.attr, 785 + &sensor_dev_attr_auto_temp3_off.dev_attr.attr, 786 + &sensor_dev_attr_auto_temp3_min.dev_attr.attr, 787 + &sensor_dev_attr_auto_temp3_max.dev_attr.attr, 788 + &sensor_dev_attr_auto_fan2_min_pwm.dev_attr.attr, 728 789 NULL 729 790 }; 730 791