aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7470.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/adt7470.c')
-rw-r--r--drivers/hwmon/adt7470.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index c6d1ce059aea..5e10c79f2dfd 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -449,7 +449,7 @@ static ssize_t set_auto_update_interval(struct device *dev,
449 struct adt7470_data *data = i2c_get_clientdata(client); 449 struct adt7470_data *data = i2c_get_clientdata(client);
450 long temp; 450 long temp;
451 451
452 if (strict_strtol(buf, 10, &temp)) 452 if (kstrtol(buf, 10, &temp))
453 return -EINVAL; 453 return -EINVAL;
454 454
455 temp = SENSORS_LIMIT(temp, 0, 60000); 455 temp = SENSORS_LIMIT(temp, 0, 60000);
@@ -478,7 +478,7 @@ static ssize_t set_num_temp_sensors(struct device *dev,
478 struct adt7470_data *data = i2c_get_clientdata(client); 478 struct adt7470_data *data = i2c_get_clientdata(client);
479 long temp; 479 long temp;
480 480
481 if (strict_strtol(buf, 10, &temp)) 481 if (kstrtol(buf, 10, &temp))
482 return -EINVAL; 482 return -EINVAL;
483 483
484 temp = SENSORS_LIMIT(temp, -1, 10); 484 temp = SENSORS_LIMIT(temp, -1, 10);
@@ -511,7 +511,7 @@ static ssize_t set_temp_min(struct device *dev,
511 struct adt7470_data *data = i2c_get_clientdata(client); 511 struct adt7470_data *data = i2c_get_clientdata(client);
512 long temp; 512 long temp;
513 513
514 if (strict_strtol(buf, 10, &temp)) 514 if (kstrtol(buf, 10, &temp))
515 return -EINVAL; 515 return -EINVAL;
516 516
517 temp = DIV_ROUND_CLOSEST(temp, 1000); 517 temp = DIV_ROUND_CLOSEST(temp, 1000);
@@ -545,7 +545,7 @@ static ssize_t set_temp_max(struct device *dev,
545 struct adt7470_data *data = i2c_get_clientdata(client); 545 struct adt7470_data *data = i2c_get_clientdata(client);
546 long temp; 546 long temp;
547 547
548 if (strict_strtol(buf, 10, &temp)) 548 if (kstrtol(buf, 10, &temp))
549 return -EINVAL; 549 return -EINVAL;
550 550
551 temp = DIV_ROUND_CLOSEST(temp, 1000); 551 temp = DIV_ROUND_CLOSEST(temp, 1000);
@@ -600,7 +600,7 @@ static ssize_t set_fan_max(struct device *dev,
600 struct adt7470_data *data = i2c_get_clientdata(client); 600 struct adt7470_data *data = i2c_get_clientdata(client);
601 long temp; 601 long temp;
602 602
603 if (strict_strtol(buf, 10, &temp) || !temp) 603 if (kstrtol(buf, 10, &temp) || !temp)
604 return -EINVAL; 604 return -EINVAL;
605 605
606 temp = FAN_RPM_TO_PERIOD(temp); 606 temp = FAN_RPM_TO_PERIOD(temp);
@@ -637,7 +637,7 @@ static ssize_t set_fan_min(struct device *dev,
637 struct adt7470_data *data = i2c_get_clientdata(client); 637 struct adt7470_data *data = i2c_get_clientdata(client);
638 long temp; 638 long temp;
639 639
640 if (strict_strtol(buf, 10, &temp) || !temp) 640 if (kstrtol(buf, 10, &temp) || !temp)
641 return -EINVAL; 641 return -EINVAL;
642 642
643 temp = FAN_RPM_TO_PERIOD(temp); 643 temp = FAN_RPM_TO_PERIOD(temp);
@@ -682,7 +682,7 @@ static ssize_t set_force_pwm_max(struct device *dev,
682 long temp; 682 long temp;
683 u8 reg; 683 u8 reg;
684 684
685 if (strict_strtol(buf, 10, &temp)) 685 if (kstrtol(buf, 10, &temp))
686 return -EINVAL; 686 return -EINVAL;
687 687
688 mutex_lock(&data->lock); 688 mutex_lock(&data->lock);
@@ -714,7 +714,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr,
714 struct adt7470_data *data = i2c_get_clientdata(client); 714 struct adt7470_data *data = i2c_get_clientdata(client);
715 long temp; 715 long temp;
716 716
717 if (strict_strtol(buf, 10, &temp)) 717 if (kstrtol(buf, 10, &temp))
718 return -EINVAL; 718 return -EINVAL;
719 719
720 temp = SENSORS_LIMIT(temp, 0, 255); 720 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -746,7 +746,7 @@ static ssize_t set_pwm_max(struct device *dev,
746 struct adt7470_data *data = i2c_get_clientdata(client); 746 struct adt7470_data *data = i2c_get_clientdata(client);
747 long temp; 747 long temp;
748 748
749 if (strict_strtol(buf, 10, &temp)) 749 if (kstrtol(buf, 10, &temp))
750 return -EINVAL; 750 return -EINVAL;
751 751
752 temp = SENSORS_LIMIT(temp, 0, 255); 752 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -779,7 +779,7 @@ static ssize_t set_pwm_min(struct device *dev,
779 struct adt7470_data *data = i2c_get_clientdata(client); 779 struct adt7470_data *data = i2c_get_clientdata(client);
780 long temp; 780 long temp;
781 781
782 if (strict_strtol(buf, 10, &temp)) 782 if (kstrtol(buf, 10, &temp))
783 return -EINVAL; 783 return -EINVAL;
784 784
785 temp = SENSORS_LIMIT(temp, 0, 255); 785 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -822,7 +822,7 @@ static ssize_t set_pwm_tmin(struct device *dev,
822 struct adt7470_data *data = i2c_get_clientdata(client); 822 struct adt7470_data *data = i2c_get_clientdata(client);
823 long temp; 823 long temp;
824 824
825 if (strict_strtol(buf, 10, &temp)) 825 if (kstrtol(buf, 10, &temp))
826 return -EINVAL; 826 return -EINVAL;
827 827
828 temp = DIV_ROUND_CLOSEST(temp, 1000); 828 temp = DIV_ROUND_CLOSEST(temp, 1000);
@@ -859,7 +859,7 @@ static ssize_t set_pwm_auto(struct device *dev,
859 long temp; 859 long temp;
860 u8 reg; 860 u8 reg;
861 861
862 if (strict_strtol(buf, 10, &temp)) 862 if (kstrtol(buf, 10, &temp))
863 return -EINVAL; 863 return -EINVAL;
864 864
865 if (attr->index % 2) 865 if (attr->index % 2)
@@ -919,7 +919,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev,
919 long temp; 919 long temp;
920 u8 reg; 920 u8 reg;
921 921
922 if (strict_strtol(buf, 10, &temp)) 922 if (kstrtol(buf, 10, &temp))
923 return -EINVAL; 923 return -EINVAL;
924 924
925 temp = cvt_auto_temp(temp); 925 temp = cvt_auto_temp(temp);