aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2012-01-04 14:58:52 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-01-05 11:19:34 -0500
commit179c4fdb565dd2157e5dfe89318b74868e3b523d (patch)
tree66c8b705260562df090a5061af2be9c80b71cd4b /drivers
parent24edc0a71badc13a9574b060e6a22e78339ac7a4 (diff)
hwmon: replaced strict_str* with kstr*
replaced strict_strtol with kstrtol and replaced strict_strtuol with kstrtuol This satisfies checkpatch -f Compile tested only: no warnings or errors given Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/acpi_power_meter.c6
-rw-r--r--drivers/hwmon/adcxx.c2
-rw-r--r--drivers/hwmon/adm1031.c2
-rw-r--r--drivers/hwmon/adm9240.c2
-rw-r--r--drivers/hwmon/adt7411.c2
-rw-r--r--drivers/hwmon/adt7462.c28
-rw-r--r--drivers/hwmon/adt7470.c26
-rw-r--r--drivers/hwmon/adt7475.c20
-rw-r--r--drivers/hwmon/amc6821.c14
-rw-r--r--drivers/hwmon/applesmc.c6
-rw-r--r--drivers/hwmon/asc7621.c24
-rw-r--r--drivers/hwmon/ds620.c2
-rw-r--r--drivers/hwmon/emc1403.c6
-rw-r--r--drivers/hwmon/emc2103.c10
-rw-r--r--drivers/hwmon/emc6w201.c6
-rw-r--r--drivers/hwmon/f71882fg.c32
-rw-r--r--drivers/hwmon/g760a.c2
-rw-r--r--drivers/hwmon/gpio-fan.c6
-rw-r--r--drivers/hwmon/ibmaem.c2
-rw-r--r--drivers/hwmon/it87.c34
-rw-r--r--drivers/hwmon/jc42.c4
-rw-r--r--drivers/hwmon/lm73.c2
-rw-r--r--drivers/hwmon/lm90.c10
-rw-r--r--drivers/hwmon/lm95241.c8
-rw-r--r--drivers/hwmon/lm95245.c8
-rw-r--r--drivers/hwmon/max16065.c2
-rw-r--r--drivers/hwmon/max6639.c8
-rw-r--r--drivers/hwmon/max6642.c2
-rw-r--r--drivers/hwmon/pc87427.c6
-rw-r--r--drivers/hwmon/sht15.c2
-rw-r--r--drivers/hwmon/tmp102.c2
-rw-r--r--drivers/hwmon/tmp401.c10
-rw-r--r--drivers/hwmon/w83627ehf.c22
-rw-r--r--drivers/hwmon/w83791d.c8
-rw-r--r--drivers/hwmon/w83792d.c2
-rw-r--r--drivers/hwmon/w83793.c2
-rw-r--r--drivers/hwmon/w83795.c32
37 files changed, 181 insertions, 181 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 66f67293341e..522860ab6ce8 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -170,7 +170,7 @@ static ssize_t set_avg_interval(struct device *dev,
170 unsigned long long data; 170 unsigned long long data;
171 acpi_status status; 171 acpi_status status;
172 172
173 res = strict_strtoul(buf, 10, &temp); 173 res = kstrtoul(buf, 10, &temp);
174 if (res) 174 if (res)
175 return res; 175 return res;
176 176
@@ -241,7 +241,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr,
241 unsigned long long data; 241 unsigned long long data;
242 acpi_status status; 242 acpi_status status;
243 243
244 res = strict_strtoul(buf, 10, &temp); 244 res = kstrtoul(buf, 10, &temp);
245 if (res) 245 if (res)
246 return res; 246 return res;
247 247
@@ -311,7 +311,7 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,
311 int res; 311 int res;
312 unsigned long temp; 312 unsigned long temp;
313 313
314 res = strict_strtoul(buf, 10, &temp); 314 res = kstrtoul(buf, 10, &temp);
315 if (res) 315 if (res)
316 return res; 316 return res;
317 317
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c
index b2cacbe707a8..ceb24a365176 100644
--- a/drivers/hwmon/adcxx.c
+++ b/drivers/hwmon/adcxx.c
@@ -125,7 +125,7 @@ static ssize_t adcxx_set_max(struct device *dev,
125 struct adcxx *adc = spi_get_drvdata(spi); 125 struct adcxx *adc = spi_get_drvdata(spi);
126 unsigned long value; 126 unsigned long value;
127 127
128 if (strict_strtoul(buf, 10, &value)) 128 if (kstrtoul(buf, 10, &value))
129 return -EINVAL; 129 return -EINVAL;
130 130
131 if (mutex_lock_interruptible(&adc->lock)) 131 if (mutex_lock_interruptible(&adc->lock))
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index 0683e6be662c..e6291dafa4ca 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -767,7 +767,7 @@ static ssize_t set_update_interval(struct device *dev,
767 int i, err; 767 int i, err;
768 u8 reg; 768 u8 reg;
769 769
770 err = strict_strtoul(buf, 10, &val); 770 err = kstrtoul(buf, 10, &val);
771 if (err) 771 if (err)
772 return err; 772 return err;
773 773
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 9e234b981b83..3f63f5f9741d 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -503,7 +503,7 @@ static ssize_t chassis_clear(struct device *dev,
503 struct adm9240_data *data = i2c_get_clientdata(client); 503 struct adm9240_data *data = i2c_get_clientdata(client);
504 unsigned long val; 504 unsigned long val;
505 505
506 if (strict_strtoul(buf, 10, &val) || val != 0) 506 if (kstrtoul(buf, 10, &val) || val != 0)
507 return -EINVAL; 507 return -EINVAL;
508 508
509 mutex_lock(&data->update_lock); 509 mutex_lock(&data->update_lock);
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c
index 5cc3e3784b42..5b02f7a91018 100644
--- a/drivers/hwmon/adt7411.c
+++ b/drivers/hwmon/adt7411.c
@@ -197,7 +197,7 @@ static ssize_t adt7411_set_bit(struct device *dev,
197 int ret; 197 int ret;
198 unsigned long flag; 198 unsigned long flag;
199 199
200 ret = strict_strtoul(buf, 0, &flag); 200 ret = kstrtoul(buf, 0, &flag);
201 if (ret || flag > 1) 201 if (ret || flag > 1)
202 return -EINVAL; 202 return -EINVAL;
203 203
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
index 2af0c7b6b4e4..7a1494846cfd 100644
--- a/drivers/hwmon/adt7462.c
+++ b/drivers/hwmon/adt7462.c
@@ -833,7 +833,7 @@ static ssize_t set_temp_min(struct device *dev,
833 struct adt7462_data *data = i2c_get_clientdata(client); 833 struct adt7462_data *data = i2c_get_clientdata(client);
834 long temp; 834 long temp;
835 835
836 if (strict_strtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) 836 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index))
837 return -EINVAL; 837 return -EINVAL;
838 838
839 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; 839 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
@@ -871,7 +871,7 @@ static ssize_t set_temp_max(struct device *dev,
871 struct adt7462_data *data = i2c_get_clientdata(client); 871 struct adt7462_data *data = i2c_get_clientdata(client);
872 long temp; 872 long temp;
873 873
874 if (strict_strtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) 874 if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index))
875 return -EINVAL; 875 return -EINVAL;
876 876
877 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; 877 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
@@ -935,7 +935,7 @@ static ssize_t set_volt_max(struct device *dev,
935 int x = voltage_multiplier(data, attr->index); 935 int x = voltage_multiplier(data, attr->index);
936 long temp; 936 long temp;
937 937
938 if (strict_strtol(buf, 10, &temp) || !x) 938 if (kstrtol(buf, 10, &temp) || !x)
939 return -EINVAL; 939 return -EINVAL;
940 940
941 temp *= 1000; /* convert mV to uV */ 941 temp *= 1000; /* convert mV to uV */
@@ -977,7 +977,7 @@ static ssize_t set_volt_min(struct device *dev,
977 int x = voltage_multiplier(data, attr->index); 977 int x = voltage_multiplier(data, attr->index);
978 long temp; 978 long temp;
979 979
980 if (strict_strtol(buf, 10, &temp) || !x) 980 if (kstrtol(buf, 10, &temp) || !x)
981 return -EINVAL; 981 return -EINVAL;
982 982
983 temp *= 1000; /* convert mV to uV */ 983 temp *= 1000; /* convert mV to uV */
@@ -1066,7 +1066,7 @@ static ssize_t set_fan_min(struct device *dev,
1066 struct adt7462_data *data = i2c_get_clientdata(client); 1066 struct adt7462_data *data = i2c_get_clientdata(client);
1067 long temp; 1067 long temp;
1068 1068
1069 if (strict_strtol(buf, 10, &temp) || !temp || 1069 if (kstrtol(buf, 10, &temp) || !temp ||
1070 !fan_enabled(data, attr->index)) 1070 !fan_enabled(data, attr->index))
1071 return -EINVAL; 1071 return -EINVAL;
1072 1072
@@ -1115,7 +1115,7 @@ static ssize_t set_force_pwm_max(struct device *dev,
1115 long temp; 1115 long temp;
1116 u8 reg; 1116 u8 reg;
1117 1117
1118 if (strict_strtol(buf, 10, &temp)) 1118 if (kstrtol(buf, 10, &temp))
1119 return -EINVAL; 1119 return -EINVAL;
1120 1120
1121 mutex_lock(&data->lock); 1121 mutex_lock(&data->lock);
@@ -1147,7 +1147,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr,
1147 struct adt7462_data *data = i2c_get_clientdata(client); 1147 struct adt7462_data *data = i2c_get_clientdata(client);
1148 long temp; 1148 long temp;
1149 1149
1150 if (strict_strtol(buf, 10, &temp)) 1150 if (kstrtol(buf, 10, &temp))
1151 return -EINVAL; 1151 return -EINVAL;
1152 1152
1153 temp = SENSORS_LIMIT(temp, 0, 255); 1153 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -1177,7 +1177,7 @@ static ssize_t set_pwm_max(struct device *dev,
1177 struct adt7462_data *data = i2c_get_clientdata(client); 1177 struct adt7462_data *data = i2c_get_clientdata(client);
1178 long temp; 1178 long temp;
1179 1179
1180 if (strict_strtol(buf, 10, &temp)) 1180 if (kstrtol(buf, 10, &temp))
1181 return -EINVAL; 1181 return -EINVAL;
1182 1182
1183 temp = SENSORS_LIMIT(temp, 0, 255); 1183 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -1209,7 +1209,7 @@ static ssize_t set_pwm_min(struct device *dev,
1209 struct adt7462_data *data = i2c_get_clientdata(client); 1209 struct adt7462_data *data = i2c_get_clientdata(client);
1210 long temp; 1210 long temp;
1211 1211
1212 if (strict_strtol(buf, 10, &temp)) 1212 if (kstrtol(buf, 10, &temp))
1213 return -EINVAL; 1213 return -EINVAL;
1214 1214
1215 temp = SENSORS_LIMIT(temp, 0, 255); 1215 temp = SENSORS_LIMIT(temp, 0, 255);
@@ -1243,7 +1243,7 @@ static ssize_t set_pwm_hyst(struct device *dev,
1243 struct adt7462_data *data = i2c_get_clientdata(client); 1243 struct adt7462_data *data = i2c_get_clientdata(client);
1244 long temp; 1244 long temp;
1245 1245
1246 if (strict_strtol(buf, 10, &temp)) 1246 if (kstrtol(buf, 10, &temp))
1247 return -EINVAL; 1247 return -EINVAL;
1248 1248
1249 temp = DIV_ROUND_CLOSEST(temp, 1000); 1249 temp = DIV_ROUND_CLOSEST(temp, 1000);
@@ -1289,7 +1289,7 @@ static ssize_t set_pwm_tmax(struct device *dev,
1289 int tmin, trange_value; 1289 int tmin, trange_value;
1290 long trange; 1290 long trange;
1291 1291
1292 if (strict_strtol(buf, 10, &trange)) 1292 if (kstrtol(buf, 10, &trange))
1293 return -EINVAL; 1293 return -EINVAL;
1294 1294
1295 /* trange = tmax - tmin */ 1295 /* trange = tmax - tmin */
@@ -1330,7 +1330,7 @@ static ssize_t set_pwm_tmin(struct device *dev,
1330 struct adt7462_data *data = i2c_get_clientdata(client); 1330 struct adt7462_data *data = i2c_get_clientdata(client);
1331 long temp; 1331 long temp;
1332 1332
1333 if (strict_strtol(buf, 10, &temp)) 1333 if (kstrtol(buf, 10, &temp))
1334 return -EINVAL; 1334 return -EINVAL;
1335 1335
1336 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; 1336 temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
@@ -1387,7 +1387,7 @@ static ssize_t set_pwm_auto(struct device *dev,
1387 struct adt7462_data *data = i2c_get_clientdata(client); 1387 struct adt7462_data *data = i2c_get_clientdata(client);
1388 long temp; 1388 long temp;
1389 1389
1390 if (strict_strtol(buf, 10, &temp)) 1390 if (kstrtol(buf, 10, &temp))
1391 return -EINVAL; 1391 return -EINVAL;
1392 1392
1393 switch (temp) { 1393 switch (temp) {
@@ -1446,7 +1446,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev,
1446 struct adt7462_data *data = i2c_get_clientdata(client); 1446 struct adt7462_data *data = i2c_get_clientdata(client);
1447 long temp; 1447 long temp;
1448 1448
1449 if (strict_strtol(buf, 10, &temp)) 1449 if (kstrtol(buf, 10, &temp))
1450 return -EINVAL; 1450 return -EINVAL;
1451 1451
1452 temp = cvt_auto_temp(temp); 1452 temp = cvt_auto_temp(temp);
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);
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index b5fcd87931cb..7dab3547fee5 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -343,7 +343,7 @@ static ssize_t set_voltage(struct device *dev, struct device_attribute *attr,
343 unsigned char reg; 343 unsigned char reg;
344 long val; 344 long val;
345 345
346 if (strict_strtol(buf, 10, &val)) 346 if (kstrtol(buf, 10, &val))
347 return -EINVAL; 347 return -EINVAL;
348 348
349 mutex_lock(&data->lock); 349 mutex_lock(&data->lock);
@@ -432,7 +432,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *attr,
432 int temp; 432 int temp;
433 long val; 433 long val;
434 434
435 if (strict_strtol(buf, 10, &val)) 435 if (kstrtol(buf, 10, &val))
436 return -EINVAL; 436 return -EINVAL;
437 437
438 mutex_lock(&data->lock); 438 mutex_lock(&data->lock);
@@ -546,7 +546,7 @@ static ssize_t set_point2(struct device *dev, struct device_attribute *attr,
546 int temp; 546 int temp;
547 long val; 547 long val;
548 548
549 if (strict_strtol(buf, 10, &val)) 549 if (kstrtol(buf, 10, &val))
550 return -EINVAL; 550 return -EINVAL;
551 551
552 mutex_lock(&data->lock); 552 mutex_lock(&data->lock);
@@ -602,7 +602,7 @@ static ssize_t set_tach(struct device *dev, struct device_attribute *attr,
602 struct adt7475_data *data = i2c_get_clientdata(client); 602 struct adt7475_data *data = i2c_get_clientdata(client);
603 unsigned long val; 603 unsigned long val;
604 604
605 if (strict_strtoul(buf, 10, &val)) 605 if (kstrtoul(buf, 10, &val))
606 return -EINVAL; 606 return -EINVAL;
607 607
608 mutex_lock(&data->lock); 608 mutex_lock(&data->lock);
@@ -653,7 +653,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
653 unsigned char reg = 0; 653 unsigned char reg = 0;
654 long val; 654 long val;
655 655
656 if (strict_strtol(buf, 10, &val)) 656 if (kstrtol(buf, 10, &val))
657 return -EINVAL; 657 return -EINVAL;
658 658
659 mutex_lock(&data->lock); 659 mutex_lock(&data->lock);
@@ -758,7 +758,7 @@ static ssize_t set_pwmchan(struct device *dev, struct device_attribute *attr,
758 int r; 758 int r;
759 long val; 759 long val;
760 760
761 if (strict_strtol(buf, 10, &val)) 761 if (kstrtol(buf, 10, &val))
762 return -EINVAL; 762 return -EINVAL;
763 763
764 mutex_lock(&data->lock); 764 mutex_lock(&data->lock);
@@ -781,7 +781,7 @@ static ssize_t set_pwmctrl(struct device *dev, struct device_attribute *attr,
781 int r; 781 int r;
782 long val; 782 long val;
783 783
784 if (strict_strtol(buf, 10, &val)) 784 if (kstrtol(buf, 10, &val))
785 return -EINVAL; 785 return -EINVAL;
786 786
787 mutex_lock(&data->lock); 787 mutex_lock(&data->lock);
@@ -819,7 +819,7 @@ static ssize_t set_pwmfreq(struct device *dev, struct device_attribute *attr,
819 int out; 819 int out;
820 long val; 820 long val;
821 821
822 if (strict_strtol(buf, 10, &val)) 822 if (kstrtol(buf, 10, &val))
823 return -EINVAL; 823 return -EINVAL;
824 824
825 out = find_nearest(val, pwmfreq_table, ARRAY_SIZE(pwmfreq_table)); 825 out = find_nearest(val, pwmfreq_table, ARRAY_SIZE(pwmfreq_table));
@@ -853,7 +853,7 @@ static ssize_t set_pwm_at_crit(struct device *dev,
853 struct adt7475_data *data = i2c_get_clientdata(client); 853 struct adt7475_data *data = i2c_get_clientdata(client);
854 long val; 854 long val;
855 855
856 if (strict_strtol(buf, 10, &val)) 856 if (kstrtol(buf, 10, &val))
857 return -EINVAL; 857 return -EINVAL;
858 if (val != 0 && val != 1) 858 if (val != 0 && val != 1)
859 return -EINVAL; 859 return -EINVAL;
@@ -883,7 +883,7 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *devattr,
883 struct adt7475_data *data = dev_get_drvdata(dev); 883 struct adt7475_data *data = dev_get_drvdata(dev);
884 long val; 884 long val;
885 885
886 if (strict_strtol(buf, 10, &val)) 886 if (kstrtol(buf, 10, &val))
887 return -EINVAL; 887 return -EINVAL;
888 if (val < 0 || val > 255) 888 if (val < 0 || val > 255)
889 return -EINVAL; 889 return -EINVAL;
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c
index 4033974d1bb3..89a6b9da0ec3 100644
--- a/drivers/hwmon/amc6821.c
+++ b/drivers/hwmon/amc6821.c
@@ -238,7 +238,7 @@ static ssize_t set_temp(
238 int ix = to_sensor_dev_attr(attr)->index; 238 int ix = to_sensor_dev_attr(attr)->index;
239 long val; 239 long val;
240 240
241 int ret = strict_strtol(buf, 10, &val); 241 int ret = kstrtol(buf, 10, &val);
242 if (ret) 242 if (ret)
243 return ret; 243 return ret;
244 val = SENSORS_LIMIT(val / 1000, -128, 127); 244 val = SENSORS_LIMIT(val / 1000, -128, 127);
@@ -327,7 +327,7 @@ static ssize_t set_pwm1(
327 struct i2c_client *client = to_i2c_client(dev); 327 struct i2c_client *client = to_i2c_client(dev);
328 struct amc6821_data *data = i2c_get_clientdata(client); 328 struct amc6821_data *data = i2c_get_clientdata(client);
329 long val; 329 long val;
330 int ret = strict_strtol(buf, 10, &val); 330 int ret = kstrtol(buf, 10, &val);
331 if (ret) 331 if (ret)
332 return ret; 332 return ret;
333 333
@@ -356,7 +356,7 @@ static ssize_t set_pwm1_enable(
356 struct i2c_client *client = to_i2c_client(dev); 356 struct i2c_client *client = to_i2c_client(dev);
357 struct amc6821_data *data = i2c_get_clientdata(client); 357 struct amc6821_data *data = i2c_get_clientdata(client);
358 long val; 358 long val;
359 int config = strict_strtol(buf, 10, &val); 359 int config = kstrtol(buf, 10, &val);
360 if (config) 360 if (config)
361 return config; 361 return config;
362 362
@@ -477,7 +477,7 @@ static ssize_t set_temp_auto_point_temp(
477 u8 reg; 477 u8 reg;
478 int dpwm; 478 int dpwm;
479 long val; 479 long val;
480 int ret = strict_strtol(buf, 10, &val); 480 int ret = kstrtol(buf, 10, &val);
481 if (ret) 481 if (ret)
482 return ret; 482 return ret;
483 483
@@ -556,7 +556,7 @@ static ssize_t set_pwm1_auto_point_pwm(
556 struct amc6821_data *data = i2c_get_clientdata(client); 556 struct amc6821_data *data = i2c_get_clientdata(client);
557 int dpwm; 557 int dpwm;
558 long val; 558 long val;
559 int ret = strict_strtol(buf, 10, &val); 559 int ret = kstrtol(buf, 10, &val);
560 if (ret) 560 if (ret)
561 return ret; 561 return ret;
562 562
@@ -623,7 +623,7 @@ static ssize_t set_fan(
623 struct amc6821_data *data = i2c_get_clientdata(client); 623 struct amc6821_data *data = i2c_get_clientdata(client);
624 long val; 624 long val;
625 int ix = to_sensor_dev_attr(attr)->index; 625 int ix = to_sensor_dev_attr(attr)->index;
626 int ret = strict_strtol(buf, 10, &val); 626 int ret = kstrtol(buf, 10, &val);
627 if (ret) 627 if (ret)
628 return ret; 628 return ret;
629 val = 1 > val ? 0xFFFF : 6000000/val; 629 val = 1 > val ? 0xFFFF : 6000000/val;
@@ -665,7 +665,7 @@ static ssize_t set_fan1_div(
665 struct i2c_client *client = to_i2c_client(dev); 665 struct i2c_client *client = to_i2c_client(dev);
666 struct amc6821_data *data = i2c_get_clientdata(client); 666 struct amc6821_data *data = i2c_get_clientdata(client);
667 long val; 667 long val;
668 int config = strict_strtol(buf, 10, &val); 668 int config = kstrtol(buf, 10, &val);
669 if (config) 669 if (config)
670 return config; 670 return config;
671 671
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 4c0743660e9c..b9895531240d 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -782,7 +782,7 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
782 char newkey[5]; 782 char newkey[5];
783 u8 buffer[2]; 783 u8 buffer[2];
784 784
785 if (strict_strtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000) 785 if (kstrtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000)
786 return -EINVAL; /* Bigger than a 14-bit value */ 786 return -EINVAL; /* Bigger than a 14-bit value */
787 787
788 sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr)); 788 sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr));
@@ -822,7 +822,7 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
822 unsigned long input; 822 unsigned long input;
823 u16 val; 823 u16 val;
824 824
825 if (strict_strtoul(sysfsbuf, 10, &input) < 0) 825 if (kstrtoul(sysfsbuf, 10, &input) < 0)
826 return -EINVAL; 826 return -EINVAL;
827 827
828 ret = applesmc_read_key(FANS_MANUAL, buffer, 2); 828 ret = applesmc_read_key(FANS_MANUAL, buffer, 2);
@@ -977,7 +977,7 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
977{ 977{
978 unsigned long newkey; 978 unsigned long newkey;
979 979
980 if (strict_strtoul(sysfsbuf, 10, &newkey) < 0 980 if (kstrtoul(sysfsbuf, 10, &newkey) < 0
981 || newkey >= smcreg.key_count) 981 || newkey >= smcreg.key_count)
982 return -EINVAL; 982 return -EINVAL;
983 983
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c
index d2596cec18b5..3efd32449982 100644
--- a/drivers/hwmon/asc7621.c
+++ b/drivers/hwmon/asc7621.c
@@ -188,7 +188,7 @@ static ssize_t store_u8(struct device *dev, struct device_attribute *attr,
188 SETUP_STORE_data_param(dev, attr); 188 SETUP_STORE_data_param(dev, attr);
189 long reqval; 189 long reqval;
190 190
191 if (strict_strtol(buf, 10, &reqval)) 191 if (kstrtol(buf, 10, &reqval))
192 return -EINVAL; 192 return -EINVAL;
193 193
194 reqval = SENSORS_LIMIT(reqval, 0, 255); 194 reqval = SENSORS_LIMIT(reqval, 0, 255);
@@ -221,7 +221,7 @@ static ssize_t store_bitmask(struct device *dev,
221 long reqval; 221 long reqval;
222 u8 currval; 222 u8 currval;
223 223
224 if (strict_strtol(buf, 10, &reqval)) 224 if (kstrtol(buf, 10, &reqval))
225 return -EINVAL; 225 return -EINVAL;
226 226
227 reqval = SENSORS_LIMIT(reqval, 0, param->mask[0]); 227 reqval = SENSORS_LIMIT(reqval, 0, param->mask[0]);
@@ -265,7 +265,7 @@ static ssize_t store_fan16(struct device *dev,
265 SETUP_STORE_data_param(dev, attr); 265 SETUP_STORE_data_param(dev, attr);
266 long reqval; 266 long reqval;
267 267
268 if (strict_strtol(buf, 10, &reqval)) 268 if (kstrtol(buf, 10, &reqval))
269 return -EINVAL; 269 return -EINVAL;
270 270
271 /* If a minimum RPM of zero is requested, then we set the register to 271 /* If a minimum RPM of zero is requested, then we set the register to
@@ -338,7 +338,7 @@ static ssize_t store_in8(struct device *dev, struct device_attribute *attr,
338 long reqval; 338 long reqval;
339 u8 nr = sda->index; 339 u8 nr = sda->index;
340 340
341 if (strict_strtol(buf, 10, &reqval)) 341 if (kstrtol(buf, 10, &reqval))
342 return -EINVAL; 342 return -EINVAL;
343 343
344 reqval = SENSORS_LIMIT(reqval, 0, 0xffff); 344 reqval = SENSORS_LIMIT(reqval, 0, 0xffff);
@@ -371,7 +371,7 @@ static ssize_t store_temp8(struct device *dev,
371 long reqval; 371 long reqval;
372 s8 temp; 372 s8 temp;
373 373
374 if (strict_strtol(buf, 10, &reqval)) 374 if (kstrtol(buf, 10, &reqval))
375 return -EINVAL; 375 return -EINVAL;
376 376
377 reqval = SENSORS_LIMIT(reqval, -127000, 127000); 377 reqval = SENSORS_LIMIT(reqval, -127000, 127000);
@@ -427,7 +427,7 @@ static ssize_t store_temp62(struct device *dev,
427 long reqval, i, f; 427 long reqval, i, f;
428 s8 temp; 428 s8 temp;
429 429
430 if (strict_strtol(buf, 10, &reqval)) 430 if (kstrtol(buf, 10, &reqval))
431 return -EINVAL; 431 return -EINVAL;
432 432
433 reqval = SENSORS_LIMIT(reqval, -32000, 31750); 433 reqval = SENSORS_LIMIT(reqval, -32000, 31750);
@@ -482,7 +482,7 @@ static ssize_t store_ap2_temp(struct device *dev,
482 int i; 482 int i;
483 u8 currval, newval = 0; 483 u8 currval, newval = 0;
484 484
485 if (strict_strtol(buf, 10, &reqval)) 485 if (kstrtol(buf, 10, &reqval))
486 return -EINVAL; 486 return -EINVAL;
487 487
488 mutex_lock(&data->update_lock); 488 mutex_lock(&data->update_lock);
@@ -538,7 +538,7 @@ static ssize_t store_pwm_ac(struct device *dev,
538 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 538 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
539 }; 539 };
540 540
541 if (strict_strtoul(buf, 10, &reqval)) 541 if (kstrtoul(buf, 10, &reqval))
542 return -EINVAL; 542 return -EINVAL;
543 543
544 if (reqval > 31) 544 if (reqval > 31)
@@ -601,7 +601,7 @@ static ssize_t store_pwm_enable(struct device *dev,
601 long reqval; 601 long reqval;
602 u8 currval, config, altbit, newval, minoff = 255; 602 u8 currval, config, altbit, newval, minoff = 255;
603 603
604 if (strict_strtol(buf, 10, &reqval)) 604 if (kstrtol(buf, 10, &reqval))
605 return -EINVAL; 605 return -EINVAL;
606 606
607 switch (reqval) { 607 switch (reqval) {
@@ -675,7 +675,7 @@ static ssize_t store_pwm_freq(struct device *dev,
675 u8 currval, newval = 255; 675 u8 currval, newval = 255;
676 int i; 676 int i;
677 677
678 if (strict_strtoul(buf, 10, &reqval)) 678 if (kstrtoul(buf, 10, &reqval))
679 return -EINVAL; 679 return -EINVAL;
680 680
681 for (i = 0; i < ARRAY_SIZE(asc7621_pwm_freq_map); i++) { 681 for (i = 0; i < ARRAY_SIZE(asc7621_pwm_freq_map); i++) {
@@ -724,7 +724,7 @@ static ssize_t store_pwm_ast(struct device *dev,
724 u8 currval, newval = 255; 724 u8 currval, newval = 255;
725 u32 i; 725 u32 i;
726 726
727 if (strict_strtol(buf, 10, &reqval)) 727 if (kstrtol(buf, 10, &reqval))
728 return -EINVAL; 728 return -EINVAL;
729 729
730 for (i = 0; i < ARRAY_SIZE(asc7621_pwm_auto_spinup_map); i++) { 730 for (i = 0; i < ARRAY_SIZE(asc7621_pwm_auto_spinup_map); i++) {
@@ -771,7 +771,7 @@ static ssize_t store_temp_st(struct device *dev,
771 u8 currval, newval = 255; 771 u8 currval, newval = 255;
772 u32 i; 772 u32 i;
773 773
774 if (strict_strtol(buf, 10, &reqval)) 774 if (kstrtol(buf, 10, &reqval))
775 return -EINVAL; 775 return -EINVAL;
776 776
777 for (i = 0; i < ARRAY_SIZE(asc7621_temp_smoothing_time_map); i++) { 777 for (i = 0; i < ARRAY_SIZE(asc7621_temp_smoothing_time_map); i++) {
diff --git a/drivers/hwmon/ds620.c b/drivers/hwmon/ds620.c
index 225ae4f36583..300c3d4d67df 100644
--- a/drivers/hwmon/ds620.c
+++ b/drivers/hwmon/ds620.c
@@ -161,7 +161,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
161 struct i2c_client *client = to_i2c_client(dev); 161 struct i2c_client *client = to_i2c_client(dev);
162 struct ds620_data *data = i2c_get_clientdata(client); 162 struct ds620_data *data = i2c_get_clientdata(client);
163 163
164 res = strict_strtol(buf, 10, &val); 164 res = kstrtol(buf, 10, &val);
165 165
166 if (res) 166 if (res)
167 return res; 167 return res;
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index cd2a6e437aec..270ffab711cb 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -80,7 +80,7 @@ static ssize_t store_temp(struct device *dev,
80 unsigned long val; 80 unsigned long val;
81 int retval; 81 int retval;
82 82
83 if (strict_strtoul(buf, 10, &val)) 83 if (kstrtoul(buf, 10, &val))
84 return -EINVAL; 84 return -EINVAL;
85 retval = i2c_smbus_write_byte_data(client, sda->index, 85 retval = i2c_smbus_write_byte_data(client, sda->index,
86 DIV_ROUND_CLOSEST(val, 1000)); 86 DIV_ROUND_CLOSEST(val, 1000));
@@ -98,7 +98,7 @@ static ssize_t store_bit(struct device *dev,
98 unsigned long val; 98 unsigned long val;
99 int retval; 99 int retval;
100 100
101 if (strict_strtoul(buf, 10, &val)) 101 if (kstrtoul(buf, 10, &val))
102 return -EINVAL; 102 return -EINVAL;
103 103
104 mutex_lock(&data->mutex); 104 mutex_lock(&data->mutex);
@@ -151,7 +151,7 @@ static ssize_t store_hyst(struct device *dev,
151 int hyst; 151 int hyst;
152 unsigned long val; 152 unsigned long val;
153 153
154 if (strict_strtoul(buf, 10, &val)) 154 if (kstrtoul(buf, 10, &val))
155 return -EINVAL; 155 return -EINVAL;
156 156
157 mutex_lock(&data->mutex); 157 mutex_lock(&data->mutex);
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c
index af914ad93ece..848a2b0bc83f 100644
--- a/drivers/hwmon/emc2103.c
+++ b/drivers/hwmon/emc2103.c
@@ -244,7 +244,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da,
244 struct emc2103_data *data = i2c_get_clientdata(client); 244 struct emc2103_data *data = i2c_get_clientdata(client);
245 long val; 245 long val;
246 246
247 int result = strict_strtol(buf, 10, &val); 247 int result = kstrtol(buf, 10, &val);
248 if (result < 0) 248 if (result < 0)
249 return -EINVAL; 249 return -EINVAL;
250 250
@@ -268,7 +268,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da,
268 struct emc2103_data *data = i2c_get_clientdata(client); 268 struct emc2103_data *data = i2c_get_clientdata(client);
269 long val; 269 long val;
270 270
271 int result = strict_strtol(buf, 10, &val); 271 int result = kstrtol(buf, 10, &val);
272 if (result < 0) 272 if (result < 0)
273 return -EINVAL; 273 return -EINVAL;
274 274
@@ -314,7 +314,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,
314 int new_range_bits, old_div = 8 / data->fan_multiplier; 314 int new_range_bits, old_div = 8 / data->fan_multiplier;
315 long new_div; 315 long new_div;
316 316
317 int status = strict_strtol(buf, 10, &new_div); 317 int status = kstrtol(buf, 10, &new_div);
318 if (status < 0) 318 if (status < 0)
319 return -EINVAL; 319 return -EINVAL;
320 320
@@ -388,7 +388,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da,
388 struct i2c_client *client = to_i2c_client(dev); 388 struct i2c_client *client = to_i2c_client(dev);
389 long rpm_target; 389 long rpm_target;
390 390
391 int result = strict_strtol(buf, 10, &rpm_target); 391 int result = kstrtol(buf, 10, &rpm_target);
392 if (result < 0) 392 if (result < 0)
393 return -EINVAL; 393 return -EINVAL;
394 394
@@ -434,7 +434,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,
434 long new_value; 434 long new_value;
435 u8 conf_reg; 435 u8 conf_reg;
436 436
437 int result = strict_strtol(buf, 10, &new_value); 437 int result = kstrtol(buf, 10, &new_value);
438 if (result < 0) 438 if (result < 0)
439 return -EINVAL; 439 return -EINVAL;
440 440
diff --git a/drivers/hwmon/emc6w201.c b/drivers/hwmon/emc6w201.c
index 0064432f361f..6ebb9b738c9c 100644
--- a/drivers/hwmon/emc6w201.c
+++ b/drivers/hwmon/emc6w201.c
@@ -212,7 +212,7 @@ static ssize_t set_in(struct device *dev, struct device_attribute *devattr,
212 long val; 212 long val;
213 u8 reg; 213 u8 reg;
214 214
215 err = strict_strtol(buf, 10, &val); 215 err = kstrtol(buf, 10, &val);
216 if (err < 0) 216 if (err < 0)
217 return err; 217 return err;
218 218
@@ -249,7 +249,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
249 long val; 249 long val;
250 u8 reg; 250 u8 reg;
251 251
252 err = strict_strtol(buf, 10, &val); 252 err = kstrtol(buf, 10, &val);
253 if (err < 0) 253 if (err < 0)
254 return err; 254 return err;
255 255
@@ -291,7 +291,7 @@ static ssize_t set_fan(struct device *dev, struct device_attribute *devattr,
291 int err; 291 int err;
292 unsigned long val; 292 unsigned long val;
293 293
294 err = strict_strtoul(buf, 10, &val); 294 err = kstrtoul(buf, 10, &val);
295 if (err < 0) 295 if (err < 0)
296 return err; 296 return err;
297 297
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index 59dd881c71d8..e50305819f01 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -1333,7 +1333,7 @@ static ssize_t store_fan_full_speed(struct device *dev,
1333 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1333 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1334 long val; 1334 long val;
1335 1335
1336 err = strict_strtol(buf, 10, &val); 1336 err = kstrtol(buf, 10, &val);
1337 if (err) 1337 if (err)
1338 return err; 1338 return err;
1339 1339
@@ -1367,7 +1367,7 @@ static ssize_t store_fan_beep(struct device *dev, struct device_attribute
1367 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1367 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1368 unsigned long val; 1368 unsigned long val;
1369 1369
1370 err = strict_strtoul(buf, 10, &val); 1370 err = kstrtoul(buf, 10, &val);
1371 if (err) 1371 if (err)
1372 return err; 1372 return err;
1373 1373
@@ -1420,7 +1420,7 @@ static ssize_t store_in_max(struct device *dev, struct device_attribute
1420 int err; 1420 int err;
1421 long val; 1421 long val;
1422 1422
1423 err = strict_strtol(buf, 10, &val); 1423 err = kstrtol(buf, 10, &val);
1424 if (err) 1424 if (err)
1425 return err; 1425 return err;
1426 1426
@@ -1454,7 +1454,7 @@ static ssize_t store_in_beep(struct device *dev, struct device_attribute
1454 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1454 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1455 unsigned long val; 1455 unsigned long val;
1456 1456
1457 err = strict_strtoul(buf, 10, &val); 1457 err = kstrtoul(buf, 10, &val);
1458 if (err) 1458 if (err)
1459 return err; 1459 return err;
1460 1460
@@ -1524,7 +1524,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute
1524 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1524 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1525 long val; 1525 long val;
1526 1526
1527 err = strict_strtol(buf, 10, &val); 1527 err = kstrtol(buf, 10, &val);
1528 if (err) 1528 if (err)
1529 return err; 1529 return err;
1530 1530
@@ -1566,7 +1566,7 @@ static ssize_t store_temp_max_hyst(struct device *dev, struct device_attribute
1566 u8 reg; 1566 u8 reg;
1567 long val; 1567 long val;
1568 1568
1569 err = strict_strtol(buf, 10, &val); 1569 err = kstrtol(buf, 10, &val);
1570 if (err) 1570 if (err)
1571 return err; 1571 return err;
1572 1572
@@ -1609,7 +1609,7 @@ static ssize_t store_temp_crit(struct device *dev, struct device_attribute
1609 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1609 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1610 long val; 1610 long val;
1611 1611
1612 err = strict_strtol(buf, 10, &val); 1612 err = kstrtol(buf, 10, &val);
1613 if (err) 1613 if (err)
1614 return err; 1614 return err;
1615 1615
@@ -1670,7 +1670,7 @@ static ssize_t store_temp_beep(struct device *dev, struct device_attribute
1670 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1670 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1671 unsigned long val; 1671 unsigned long val;
1672 1672
1673 err = strict_strtoul(buf, 10, &val); 1673 err = kstrtoul(buf, 10, &val);
1674 if (err) 1674 if (err)
1675 return err; 1675 return err;
1676 1676
@@ -1737,7 +1737,7 @@ static ssize_t store_pwm(struct device *dev,
1737 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1737 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1738 long val; 1738 long val;
1739 1739
1740 err = strict_strtol(buf, 10, &val); 1740 err = kstrtol(buf, 10, &val);
1741 if (err) 1741 if (err)
1742 return err; 1742 return err;
1743 1743
@@ -1788,7 +1788,7 @@ static ssize_t store_simple_pwm(struct device *dev,
1788 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1788 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1789 long val; 1789 long val;
1790 1790
1791 err = strict_strtol(buf, 10, &val); 1791 err = kstrtol(buf, 10, &val);
1792 if (err) 1792 if (err)
1793 return err; 1793 return err;
1794 1794
@@ -1835,7 +1835,7 @@ static ssize_t store_pwm_enable(struct device *dev, struct device_attribute
1835 int err, nr = to_sensor_dev_attr_2(devattr)->index; 1835 int err, nr = to_sensor_dev_attr_2(devattr)->index;
1836 long val; 1836 long val;
1837 1837
1838 err = strict_strtol(buf, 10, &val); 1838 err = kstrtol(buf, 10, &val);
1839 if (err) 1839 if (err)
1840 return err; 1840 return err;
1841 1841
@@ -1915,7 +1915,7 @@ static ssize_t store_pwm_auto_point_pwm(struct device *dev,
1915 int point = to_sensor_dev_attr_2(devattr)->nr; 1915 int point = to_sensor_dev_attr_2(devattr)->nr;
1916 long val; 1916 long val;
1917 1917
1918 err = strict_strtol(buf, 10, &val); 1918 err = kstrtol(buf, 10, &val);
1919 if (err) 1919 if (err)
1920 return err; 1920 return err;
1921 1921
@@ -1969,7 +1969,7 @@ static ssize_t store_pwm_auto_point_temp_hyst(struct device *dev,
1969 u8 reg; 1969 u8 reg;
1970 long val; 1970 long val;
1971 1971
1972 err = strict_strtol(buf, 10, &val); 1972 err = kstrtol(buf, 10, &val);
1973 if (err) 1973 if (err)
1974 return err; 1974 return err;
1975 1975
@@ -2015,7 +2015,7 @@ static ssize_t store_pwm_interpolate(struct device *dev,
2015 int err, nr = to_sensor_dev_attr_2(devattr)->index; 2015 int err, nr = to_sensor_dev_attr_2(devattr)->index;
2016 unsigned long val; 2016 unsigned long val;
2017 2017
2018 err = strict_strtoul(buf, 10, &val); 2018 err = kstrtoul(buf, 10, &val);
2019 if (err) 2019 if (err)
2020 return err; 2020 return err;
2021 2021
@@ -2055,7 +2055,7 @@ static ssize_t store_pwm_auto_point_channel(struct device *dev,
2055 int err, nr = to_sensor_dev_attr_2(devattr)->index; 2055 int err, nr = to_sensor_dev_attr_2(devattr)->index;
2056 long val; 2056 long val;
2057 2057
2058 err = strict_strtol(buf, 10, &val); 2058 err = kstrtol(buf, 10, &val);
2059 if (err) 2059 if (err)
2060 return err; 2060 return err;
2061 2061
@@ -2106,7 +2106,7 @@ static ssize_t store_pwm_auto_point_temp(struct device *dev,
2106 int point = to_sensor_dev_attr_2(devattr)->nr; 2106 int point = to_sensor_dev_attr_2(devattr)->nr;
2107 long val; 2107 long val;
2108 2108
2109 err = strict_strtol(buf, 10, &val); 2109 err = kstrtol(buf, 10, &val);
2110 if (err) 2110 if (err)
2111 return err; 2111 return err;
2112 2112
diff --git a/drivers/hwmon/g760a.c b/drivers/hwmon/g760a.c
index 1d6a6fa31fb4..781277ddbaa5 100644
--- a/drivers/hwmon/g760a.c
+++ b/drivers/hwmon/g760a.c
@@ -166,7 +166,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *da,
166 struct g760a_data *data = g760a_update_client(dev); 166 struct g760a_data *data = g760a_update_client(dev);
167 unsigned long val; 167 unsigned long val;
168 168
169 if (strict_strtoul(buf, 10, &val)) 169 if (kstrtoul(buf, 10, &val))
170 return -EINVAL; 170 return -EINVAL;
171 171
172 mutex_lock(&data->update_lock); 172 mutex_lock(&data->update_lock);
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 9ba38f318ffb..2ce8c44a0e07 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -224,7 +224,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
224 int speed_index; 224 int speed_index;
225 int ret = count; 225 int ret = count;
226 226
227 if (strict_strtoul(buf, 10, &pwm) || pwm > 255) 227 if (kstrtoul(buf, 10, &pwm) || pwm > 255)
228 return -EINVAL; 228 return -EINVAL;
229 229
230 mutex_lock(&fan_data->lock); 230 mutex_lock(&fan_data->lock);
@@ -257,7 +257,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
257 struct gpio_fan_data *fan_data = dev_get_drvdata(dev); 257 struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
258 unsigned long val; 258 unsigned long val;
259 259
260 if (strict_strtoul(buf, 10, &val) || val > 1) 260 if (kstrtoul(buf, 10, &val) || val > 1)
261 return -EINVAL; 261 return -EINVAL;
262 262
263 if (fan_data->pwm_enable == val) 263 if (fan_data->pwm_enable == val)
@@ -314,7 +314,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr,
314 unsigned long rpm; 314 unsigned long rpm;
315 int ret = count; 315 int ret = count;
316 316
317 if (strict_strtoul(buf, 10, &rpm)) 317 if (kstrtoul(buf, 10, &rpm))
318 return -EINVAL; 318 return -EINVAL;
319 319
320 mutex_lock(&fan_data->lock); 320 mutex_lock(&fan_data->lock);
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
index 6a967d7dbdee..cc2981f749a6 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
@@ -904,7 +904,7 @@ static ssize_t aem_set_power_period(struct device *dev,
904 unsigned long temp; 904 unsigned long temp;
905 int res; 905 int res;
906 906
907 res = strict_strtoul(buf, 10, &temp); 907 res = kstrtoul(buf, 10, &temp);
908 if (res) 908 if (res)
909 return res; 909 return res;
910 910
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index d912649fac50..38c0b87676de 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -444,7 +444,7 @@ static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
444 struct it87_data *data = dev_get_drvdata(dev); 444 struct it87_data *data = dev_get_drvdata(dev);
445 unsigned long val; 445 unsigned long val;
446 446
447 if (strict_strtoul(buf, 10, &val) < 0) 447 if (kstrtoul(buf, 10, &val) < 0)
448 return -EINVAL; 448 return -EINVAL;
449 449
450 mutex_lock(&data->update_lock); 450 mutex_lock(&data->update_lock);
@@ -463,7 +463,7 @@ static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
463 struct it87_data *data = dev_get_drvdata(dev); 463 struct it87_data *data = dev_get_drvdata(dev);
464 unsigned long val; 464 unsigned long val;
465 465
466 if (strict_strtoul(buf, 10, &val) < 0) 466 if (kstrtoul(buf, 10, &val) < 0)
467 return -EINVAL; 467 return -EINVAL;
468 468
469 mutex_lock(&data->update_lock); 469 mutex_lock(&data->update_lock);
@@ -539,7 +539,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
539 struct it87_data *data = dev_get_drvdata(dev); 539 struct it87_data *data = dev_get_drvdata(dev);
540 long val; 540 long val;
541 541
542 if (strict_strtol(buf, 10, &val) < 0) 542 if (kstrtol(buf, 10, &val) < 0)
543 return -EINVAL; 543 return -EINVAL;
544 544
545 mutex_lock(&data->update_lock); 545 mutex_lock(&data->update_lock);
@@ -557,7 +557,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
557 struct it87_data *data = dev_get_drvdata(dev); 557 struct it87_data *data = dev_get_drvdata(dev);
558 long val; 558 long val;
559 559
560 if (strict_strtol(buf, 10, &val) < 0) 560 if (kstrtol(buf, 10, &val) < 0)
561 return -EINVAL; 561 return -EINVAL;
562 562
563 mutex_lock(&data->update_lock); 563 mutex_lock(&data->update_lock);
@@ -604,7 +604,7 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr,
604 long val; 604 long val;
605 u8 reg; 605 u8 reg;
606 606
607 if (strict_strtol(buf, 10, &val) < 0) 607 if (kstrtol(buf, 10, &val) < 0)
608 return -EINVAL; 608 return -EINVAL;
609 609
610 reg = it87_read_value(data, IT87_REG_TEMP_ENABLE); 610 reg = it87_read_value(data, IT87_REG_TEMP_ENABLE);
@@ -718,7 +718,7 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
718 long val; 718 long val;
719 u8 reg; 719 u8 reg;
720 720
721 if (strict_strtol(buf, 10, &val) < 0) 721 if (kstrtol(buf, 10, &val) < 0)
722 return -EINVAL; 722 return -EINVAL;
723 723
724 mutex_lock(&data->update_lock); 724 mutex_lock(&data->update_lock);
@@ -751,7 +751,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
751 int min; 751 int min;
752 u8 old; 752 u8 old;
753 753
754 if (strict_strtoul(buf, 10, &val) < 0) 754 if (kstrtoul(buf, 10, &val) < 0)
755 return -EINVAL; 755 return -EINVAL;
756 756
757 mutex_lock(&data->update_lock); 757 mutex_lock(&data->update_lock);
@@ -820,7 +820,7 @@ static ssize_t set_pwm_enable(struct device *dev,
820 struct it87_data *data = dev_get_drvdata(dev); 820 struct it87_data *data = dev_get_drvdata(dev);
821 long val; 821 long val;
822 822
823 if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 2) 823 if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 2)
824 return -EINVAL; 824 return -EINVAL;
825 825
826 /* Check trip points before switching to automatic mode */ 826 /* Check trip points before switching to automatic mode */
@@ -866,7 +866,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
866 struct it87_data *data = dev_get_drvdata(dev); 866 struct it87_data *data = dev_get_drvdata(dev);
867 long val; 867 long val;
868 868
869 if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 255) 869 if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 255)
870 return -EINVAL; 870 return -EINVAL;
871 871
872 mutex_lock(&data->update_lock); 872 mutex_lock(&data->update_lock);
@@ -900,7 +900,7 @@ static ssize_t set_pwm_freq(struct device *dev,
900 unsigned long val; 900 unsigned long val;
901 int i; 901 int i;
902 902
903 if (strict_strtoul(buf, 10, &val) < 0) 903 if (kstrtoul(buf, 10, &val) < 0)
904 return -EINVAL; 904 return -EINVAL;
905 905
906 /* Search for the nearest available frequency */ 906 /* Search for the nearest available frequency */
@@ -949,7 +949,7 @@ static ssize_t set_pwm_temp_map(struct device *dev,
949 return -EINVAL; 949 return -EINVAL;
950 } 950 }
951 951
952 if (strict_strtol(buf, 10, &val) < 0) 952 if (kstrtol(buf, 10, &val) < 0)
953 return -EINVAL; 953 return -EINVAL;
954 954
955 switch (val) { 955 switch (val) {
@@ -1001,7 +1001,7 @@ static ssize_t set_auto_pwm(struct device *dev,
1001 int point = sensor_attr->index; 1001 int point = sensor_attr->index;
1002 long val; 1002 long val;
1003 1003
1004 if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 255) 1004 if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 255)
1005 return -EINVAL; 1005 return -EINVAL;
1006 1006
1007 mutex_lock(&data->update_lock); 1007 mutex_lock(&data->update_lock);
@@ -1034,7 +1034,7 @@ static ssize_t set_auto_temp(struct device *dev,
1034 int point = sensor_attr->index; 1034 int point = sensor_attr->index;
1035 long val; 1035 long val;
1036 1036
1037 if (strict_strtol(buf, 10, &val) < 0 || val < -128000 || val > 127000) 1037 if (kstrtol(buf, 10, &val) < 0 || val < -128000 || val > 127000)
1038 return -EINVAL; 1038 return -EINVAL;
1039 1039
1040 mutex_lock(&data->update_lock); 1040 mutex_lock(&data->update_lock);
@@ -1126,7 +1126,7 @@ static ssize_t set_fan16_min(struct device *dev, struct device_attribute *attr,
1126 struct it87_data *data = dev_get_drvdata(dev); 1126 struct it87_data *data = dev_get_drvdata(dev);
1127 long val; 1127 long val;
1128 1128
1129 if (strict_strtol(buf, 10, &val) < 0) 1129 if (kstrtol(buf, 10, &val) < 0)
1130 return -EINVAL; 1130 return -EINVAL;
1131 1131
1132 mutex_lock(&data->update_lock); 1132 mutex_lock(&data->update_lock);
@@ -1180,7 +1180,7 @@ static ssize_t clear_intrusion(struct device *dev, struct device_attribute
1180 long val; 1180 long val;
1181 int config; 1181 int config;
1182 1182
1183 if (strict_strtol(buf, 10, &val) < 0 || val != 0) 1183 if (kstrtol(buf, 10, &val) < 0 || val != 0)
1184 return -EINVAL; 1184 return -EINVAL;
1185 1185
1186 mutex_lock(&data->update_lock); 1186 mutex_lock(&data->update_lock);
@@ -1231,7 +1231,7 @@ static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
1231 struct it87_data *data = dev_get_drvdata(dev); 1231 struct it87_data *data = dev_get_drvdata(dev);
1232 long val; 1232 long val;
1233 1233
1234 if (strict_strtol(buf, 10, &val) < 0 1234 if (kstrtol(buf, 10, &val) < 0
1235 || (val != 0 && val != 1)) 1235 || (val != 0 && val != 1))
1236 return -EINVAL; 1236 return -EINVAL;
1237 1237
@@ -1278,7 +1278,7 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
1278 struct it87_data *data = dev_get_drvdata(dev); 1278 struct it87_data *data = dev_get_drvdata(dev);
1279 unsigned long val; 1279 unsigned long val;
1280 1280
1281 if (strict_strtoul(buf, 10, &val) < 0) 1281 if (kstrtoul(buf, 10, &val) < 0)
1282 return -EINVAL; 1282 return -EINVAL;
1283 1283
1284 data->vrm = val; 1284 data->vrm = val;
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 2d3d72805ff4..d8d88abb081c 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -309,7 +309,7 @@ static ssize_t set_##value(struct device *dev, \
309 struct jc42_data *data = i2c_get_clientdata(client); \ 309 struct jc42_data *data = i2c_get_clientdata(client); \
310 int err, ret = count; \ 310 int err, ret = count; \
311 long val; \ 311 long val; \
312 if (strict_strtol(buf, 10, &val) < 0) \ 312 if (kstrtol(buf, 10, &val) < 0) \
313 return -EINVAL; \ 313 return -EINVAL; \
314 mutex_lock(&data->update_lock); \ 314 mutex_lock(&data->update_lock); \
315 data->value = jc42_temp_to_reg(val, data->extended); \ 315 data->value = jc42_temp_to_reg(val, data->extended); \
@@ -337,7 +337,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev,
337 int err; 337 int err;
338 int ret = count; 338 int ret = count;
339 339
340 if (strict_strtoul(buf, 10, &val) < 0) 340 if (kstrtoul(buf, 10, &val) < 0)
341 return -EINVAL; 341 return -EINVAL;
342 342
343 diff = jc42_temp_from_reg(data->temp_crit) - val; 343 diff = jc42_temp_from_reg(data->temp_crit) - val;
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c
index 9e64d96620d3..9c8093c4b307 100644
--- a/drivers/hwmon/lm73.c
+++ b/drivers/hwmon/lm73.c
@@ -50,7 +50,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
50 long temp; 50 long temp;
51 short value; 51 short value;
52 52
53 int status = strict_strtol(buf, 10, &temp); 53 int status = kstrtol(buf, 10, &temp);
54 if (status < 0) 54 if (status < 0)
55 return status; 55 return status;
56 56
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 615bc4f4e530..bdfd675488ae 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -730,7 +730,7 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr,
730 long val; 730 long val;
731 int err; 731 int err;
732 732
733 err = strict_strtol(buf, 10, &val); 733 err = kstrtol(buf, 10, &val);
734 if (err < 0) 734 if (err < 0)
735 return err; 735 return err;
736 736
@@ -798,7 +798,7 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr,
798 long val; 798 long val;
799 int err; 799 int err;
800 800
801 err = strict_strtol(buf, 10, &val); 801 err = kstrtol(buf, 10, &val);
802 if (err < 0) 802 if (err < 0)
803 return err; 803 return err;
804 804
@@ -859,7 +859,7 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy,
859 int err; 859 int err;
860 int temp; 860 int temp;
861 861
862 err = strict_strtol(buf, 10, &val); 862 err = kstrtol(buf, 10, &val);
863 if (err < 0) 863 if (err < 0)
864 return err; 864 return err;
865 865
@@ -912,7 +912,7 @@ static ssize_t set_update_interval(struct device *dev,
912 unsigned long val; 912 unsigned long val;
913 int err; 913 int err;
914 914
915 err = strict_strtoul(buf, 10, &val); 915 err = kstrtoul(buf, 10, &val);
916 if (err) 916 if (err)
917 return err; 917 return err;
918 918
@@ -1080,7 +1080,7 @@ static ssize_t set_pec(struct device *dev, struct device_attribute *dummy,
1080 long val; 1080 long val;
1081 int err; 1081 int err;
1082 1082
1083 err = strict_strtol(buf, 10, &val); 1083 err = kstrtol(buf, 10, &val);
1084 if (err < 0) 1084 if (err < 0)
1085 return err; 1085 return err;
1086 1086
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c
index 513901d592a9..70bca671e083 100644
--- a/drivers/hwmon/lm95241.c
+++ b/drivers/hwmon/lm95241.c
@@ -169,7 +169,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
169 int shift; 169 int shift;
170 u8 mask = to_sensor_dev_attr(attr)->index; 170 u8 mask = to_sensor_dev_attr(attr)->index;
171 171
172 if (strict_strtoul(buf, 10, &val) < 0) 172 if (kstrtoul(buf, 10, &val) < 0)
173 return -EINVAL; 173 return -EINVAL;
174 if (val != 1 && val != 2) 174 if (val != 1 && val != 2)
175 return -EINVAL; 175 return -EINVAL;
@@ -216,7 +216,7 @@ static ssize_t set_min(struct device *dev, struct device_attribute *attr,
216 struct lm95241_data *data = i2c_get_clientdata(client); 216 struct lm95241_data *data = i2c_get_clientdata(client);
217 long val; 217 long val;
218 218
219 if (strict_strtol(buf, 10, &val) < 0) 219 if (kstrtol(buf, 10, &val) < 0)
220 return -EINVAL; 220 return -EINVAL;
221 if (val < -128000) 221 if (val < -128000)
222 return -EINVAL; 222 return -EINVAL;
@@ -254,7 +254,7 @@ static ssize_t set_max(struct device *dev, struct device_attribute *attr,
254 struct lm95241_data *data = i2c_get_clientdata(client); 254 struct lm95241_data *data = i2c_get_clientdata(client);
255 long val; 255 long val;
256 256
257 if (strict_strtol(buf, 10, &val) < 0) 257 if (kstrtol(buf, 10, &val) < 0)
258 return -EINVAL; 258 return -EINVAL;
259 if (val >= 256000) 259 if (val >= 256000)
260 return -EINVAL; 260 return -EINVAL;
@@ -290,7 +290,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr,
290 struct lm95241_data *data = i2c_get_clientdata(client); 290 struct lm95241_data *data = i2c_get_clientdata(client);
291 unsigned long val; 291 unsigned long val;
292 292
293 if (strict_strtoul(buf, 10, &val) < 0) 293 if (kstrtoul(buf, 10, &val) < 0)
294 return -EINVAL; 294 return -EINVAL;
295 295
296 data->interval = val * HZ / 1000; 296 data->interval = val * HZ / 1000;
diff --git a/drivers/hwmon/lm95245.c b/drivers/hwmon/lm95245.c
index dce9e68241e6..5e5fc1b0ace1 100644
--- a/drivers/hwmon/lm95245.c
+++ b/drivers/hwmon/lm95245.c
@@ -254,7 +254,7 @@ static ssize_t set_limit(struct device *dev, struct device_attribute *attr,
254 int index = to_sensor_dev_attr(attr)->index; 254 int index = to_sensor_dev_attr(attr)->index;
255 unsigned long val; 255 unsigned long val;
256 256
257 if (strict_strtoul(buf, 10, &val) < 0) 257 if (kstrtoul(buf, 10, &val) < 0)
258 return -EINVAL; 258 return -EINVAL;
259 259
260 val /= 1000; 260 val /= 1000;
@@ -279,7 +279,7 @@ static ssize_t set_crit_hyst(struct device *dev, struct device_attribute *attr,
279 struct lm95245_data *data = i2c_get_clientdata(client); 279 struct lm95245_data *data = i2c_get_clientdata(client);
280 unsigned long val; 280 unsigned long val;
281 281
282 if (strict_strtoul(buf, 10, &val) < 0) 282 if (kstrtoul(buf, 10, &val) < 0)
283 return -EINVAL; 283 return -EINVAL;
284 284
285 val /= 1000; 285 val /= 1000;
@@ -316,7 +316,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
316 struct lm95245_data *data = i2c_get_clientdata(client); 316 struct lm95245_data *data = i2c_get_clientdata(client);
317 unsigned long val; 317 unsigned long val;
318 318
319 if (strict_strtoul(buf, 10, &val) < 0) 319 if (kstrtoul(buf, 10, &val) < 0)
320 return -EINVAL; 320 return -EINVAL;
321 if (val != 1 && val != 2) 321 if (val != 1 && val != 2)
322 return -EINVAL; 322 return -EINVAL;
@@ -363,7 +363,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr,
363 struct lm95245_data *data = i2c_get_clientdata(client); 363 struct lm95245_data *data = i2c_get_clientdata(client);
364 unsigned long val; 364 unsigned long val;
365 365
366 if (strict_strtoul(buf, 10, &val) < 0) 366 if (kstrtoul(buf, 10, &val) < 0)
367 return -EINVAL; 367 return -EINVAL;
368 368
369 mutex_lock(&data->update_lock); 369 mutex_lock(&data->update_lock);
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c
index 385886a4f224..f8e323ac6cb3 100644
--- a/drivers/hwmon/max16065.c
+++ b/drivers/hwmon/max16065.c
@@ -230,7 +230,7 @@ static ssize_t max16065_set_limit(struct device *dev,
230 int err; 230 int err;
231 int limit; 231 int limit;
232 232
233 err = strict_strtoul(buf, 10, &val); 233 err = kstrtoul(buf, 10, &val);
234 if (unlikely(err < 0)) 234 if (unlikely(err < 0))
235 return err; 235 return err;
236 236
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
index f20d9978ee78..e10a092c603c 100644
--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -208,7 +208,7 @@ static ssize_t set_temp_max(struct device *dev,
208 unsigned long val; 208 unsigned long val;
209 int res; 209 int res;
210 210
211 res = strict_strtoul(buf, 10, &val); 211 res = kstrtoul(buf, 10, &val);
212 if (res) 212 if (res)
213 return res; 213 return res;
214 214
@@ -241,7 +241,7 @@ static ssize_t set_temp_crit(struct device *dev,
241 unsigned long val; 241 unsigned long val;
242 int res; 242 int res;
243 243
244 res = strict_strtoul(buf, 10, &val); 244 res = kstrtoul(buf, 10, &val);
245 if (res) 245 if (res)
246 return res; 246 return res;
247 247
@@ -275,7 +275,7 @@ static ssize_t set_temp_emergency(struct device *dev,
275 unsigned long val; 275 unsigned long val;
276 int res; 276 int res;
277 277
278 res = strict_strtoul(buf, 10, &val); 278 res = kstrtoul(buf, 10, &val);
279 if (res) 279 if (res)
280 return res; 280 return res;
281 281
@@ -308,7 +308,7 @@ static ssize_t set_pwm(struct device *dev,
308 unsigned long val; 308 unsigned long val;
309 int res; 309 int res;
310 310
311 res = strict_strtoul(buf, 10, &val); 311 res = kstrtoul(buf, 10, &val);
312 if (res) 312 if (res)
313 return res; 313 return res;
314 314
diff --git a/drivers/hwmon/max6642.c b/drivers/hwmon/max6642.c
index e855d3b0bd1f..209e8a526eb1 100644
--- a/drivers/hwmon/max6642.c
+++ b/drivers/hwmon/max6642.c
@@ -234,7 +234,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
234 struct max6642_data *data = i2c_get_clientdata(client); 234 struct max6642_data *data = i2c_get_clientdata(client);
235 struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(attr); 235 struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(attr);
236 236
237 err = strict_strtoul(buf, 10, &val); 237 err = kstrtoul(buf, 10, &val);
238 if (err < 0) 238 if (err < 0)
239 return err; 239 return err;
240 240
diff --git a/drivers/hwmon/pc87427.c b/drivers/hwmon/pc87427.c
index 8da2181630b1..cb35461d52d9 100644
--- a/drivers/hwmon/pc87427.c
+++ b/drivers/hwmon/pc87427.c
@@ -418,7 +418,7 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute
418 unsigned long val; 418 unsigned long val;
419 int iobase = data->address[LD_FAN]; 419 int iobase = data->address[LD_FAN];
420 420
421 if (strict_strtoul(buf, 10, &val) < 0) 421 if (kstrtoul(buf, 10, &val) < 0)
422 return -EINVAL; 422 return -EINVAL;
423 423
424 mutex_lock(&data->lock); 424 mutex_lock(&data->lock);
@@ -572,7 +572,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute
572 int nr = to_sensor_dev_attr(devattr)->index; 572 int nr = to_sensor_dev_attr(devattr)->index;
573 unsigned long val; 573 unsigned long val;
574 574
575 if (strict_strtoul(buf, 10, &val) < 0 || val > 2) 575 if (kstrtoul(buf, 10, &val) < 0 || val > 2)
576 return -EINVAL; 576 return -EINVAL;
577 /* Can't go to automatic mode if it isn't configured */ 577 /* Can't go to automatic mode if it isn't configured */
578 if (val == 2 && !(data->pwm_auto_ok & (1 << nr))) 578 if (val == 2 && !(data->pwm_auto_ok & (1 << nr)))
@@ -604,7 +604,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute
604 int iobase = data->address[LD_FAN]; 604 int iobase = data->address[LD_FAN];
605 u8 mode; 605 u8 mode;
606 606
607 if (strict_strtoul(buf, 10, &val) < 0 || val > 0xff) 607 if (kstrtoul(buf, 10, &val) < 0 || val > 0xff)
608 return -EINVAL; 608 return -EINVAL;
609 609
610 mutex_lock(&data->lock); 610 mutex_lock(&data->lock);
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index fe4104c6b764..6ddeae049058 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -683,7 +683,7 @@ static ssize_t sht15_store_heater(struct device *dev,
683 long value; 683 long value;
684 u8 status; 684 u8 status;
685 685
686 if (strict_strtol(buf, 10, &value)) 686 if (kstrtol(buf, 10, &value))
687 return -EINVAL; 687 return -EINVAL;
688 688
689 mutex_lock(&data->read_lock); 689 mutex_lock(&data->read_lock);
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
index 643aa8c94535..c08eee21d76e 100644
--- a/drivers/hwmon/tmp102.c
+++ b/drivers/hwmon/tmp102.c
@@ -112,7 +112,7 @@ static ssize_t tmp102_set_temp(struct device *dev,
112 long val; 112 long val;
113 int status; 113 int status;
114 114
115 if (strict_strtol(buf, 10, &val) < 0) 115 if (kstrtol(buf, 10, &val) < 0)
116 return -EINVAL; 116 return -EINVAL;
117 val = SENSORS_LIMIT(val, -256000, 255000); 117 val = SENSORS_LIMIT(val, -256000, 255000);
118 118
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index ad8d535235c5..8b9a77486d57 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -334,7 +334,7 @@ static ssize_t store_temp_min(struct device *dev, struct device_attribute
334 long val; 334 long val;
335 u16 reg; 335 u16 reg;
336 336
337 if (strict_strtol(buf, 10, &val)) 337 if (kstrtol(buf, 10, &val))
338 return -EINVAL; 338 return -EINVAL;
339 339
340 reg = tmp401_temp_to_register(val, data->config); 340 reg = tmp401_temp_to_register(val, data->config);
@@ -361,7 +361,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute
361 long val; 361 long val;
362 u16 reg; 362 u16 reg;
363 363
364 if (strict_strtol(buf, 10, &val)) 364 if (kstrtol(buf, 10, &val))
365 return -EINVAL; 365 return -EINVAL;
366 366
367 reg = tmp401_temp_to_register(val, data->config); 367 reg = tmp401_temp_to_register(val, data->config);
@@ -388,7 +388,7 @@ static ssize_t store_temp_crit(struct device *dev, struct device_attribute
388 long val; 388 long val;
389 u8 reg; 389 u8 reg;
390 390
391 if (strict_strtol(buf, 10, &val)) 391 if (kstrtol(buf, 10, &val))
392 return -EINVAL; 392 return -EINVAL;
393 393
394 reg = tmp401_crit_temp_to_register(val, data->config); 394 reg = tmp401_crit_temp_to_register(val, data->config);
@@ -413,7 +413,7 @@ static ssize_t store_temp_crit_hyst(struct device *dev, struct device_attribute
413 long val; 413 long val;
414 u8 reg; 414 u8 reg;
415 415
416 if (strict_strtol(buf, 10, &val)) 416 if (kstrtol(buf, 10, &val))
417 return -EINVAL; 417 return -EINVAL;
418 418
419 if (data->config & TMP401_CONFIG_RANGE) 419 if (data->config & TMP401_CONFIG_RANGE)
@@ -447,7 +447,7 @@ static ssize_t reset_temp_history(struct device *dev,
447{ 447{
448 long val; 448 long val;
449 449
450 if (strict_strtol(buf, 10, &val)) 450 if (kstrtol(buf, 10, &val))
451 return -EINVAL; 451 return -EINVAL;
452 452
453 if (val != 1) { 453 if (val != 1) {
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 93f5fc7d6059..0e0af0445222 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -937,7 +937,7 @@ store_in_##reg(struct device *dev, struct device_attribute *attr, \
937 int nr = sensor_attr->index; \ 937 int nr = sensor_attr->index; \
938 unsigned long val; \ 938 unsigned long val; \
939 int err; \ 939 int err; \
940 err = strict_strtoul(buf, 10, &val); \ 940 err = kstrtoul(buf, 10, &val); \
941 if (err < 0) \ 941 if (err < 0) \
942 return err; \ 942 return err; \
943 mutex_lock(&data->update_lock); \ 943 mutex_lock(&data->update_lock); \
@@ -1054,7 +1054,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
1054 unsigned int reg; 1054 unsigned int reg;
1055 u8 new_div; 1055 u8 new_div;
1056 1056
1057 err = strict_strtoul(buf, 10, &val); 1057 err = kstrtoul(buf, 10, &val);
1058 if (err < 0) 1058 if (err < 0)
1059 return err; 1059 return err;
1060 1060
@@ -1199,7 +1199,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
1199 int nr = sensor_attr->index; \ 1199 int nr = sensor_attr->index; \
1200 int err; \ 1200 int err; \
1201 long val; \ 1201 long val; \
1202 err = strict_strtol(buf, 10, &val); \ 1202 err = kstrtol(buf, 10, &val); \
1203 if (err < 0) \ 1203 if (err < 0) \
1204 return err; \ 1204 return err; \
1205 mutex_lock(&data->update_lock); \ 1205 mutex_lock(&data->update_lock); \
@@ -1324,7 +1324,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
1324 int err; 1324 int err;
1325 u16 reg; 1325 u16 reg;
1326 1326
1327 err = strict_strtoul(buf, 10, &val); 1327 err = kstrtoul(buf, 10, &val);
1328 if (err < 0) 1328 if (err < 0)
1329 return err; 1329 return err;
1330 1330
@@ -1351,7 +1351,7 @@ store_pwm(struct device *dev, struct device_attribute *attr,
1351 unsigned long val; 1351 unsigned long val;
1352 int err; 1352 int err;
1353 1353
1354 err = strict_strtoul(buf, 10, &val); 1354 err = kstrtoul(buf, 10, &val);
1355 if (err < 0) 1355 if (err < 0)
1356 return err; 1356 return err;
1357 1357
@@ -1376,7 +1376,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
1376 int err; 1376 int err;
1377 u16 reg; 1377 u16 reg;
1378 1378
1379 err = strict_strtoul(buf, 10, &val); 1379 err = kstrtoul(buf, 10, &val);
1380 if (err < 0) 1380 if (err < 0)
1381 return err; 1381 return err;
1382 1382
@@ -1430,7 +1430,7 @@ store_target_temp(struct device *dev, struct device_attribute *attr,
1430 long val; 1430 long val;
1431 int err; 1431 int err;
1432 1432
1433 err = strict_strtol(buf, 10, &val); 1433 err = kstrtol(buf, 10, &val);
1434 if (err < 0) 1434 if (err < 0)
1435 return err; 1435 return err;
1436 1436
@@ -1455,7 +1455,7 @@ store_tolerance(struct device *dev, struct device_attribute *attr,
1455 long val; 1455 long val;
1456 int err; 1456 int err;
1457 1457
1458 err = strict_strtol(buf, 10, &val); 1458 err = kstrtol(buf, 10, &val);
1459 if (err < 0) 1459 if (err < 0)
1460 return err; 1460 return err;
1461 1461
@@ -1556,7 +1556,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
1556 int nr = sensor_attr->index; \ 1556 int nr = sensor_attr->index; \
1557 unsigned long val; \ 1557 unsigned long val; \
1558 int err; \ 1558 int err; \
1559 err = strict_strtoul(buf, 10, &val); \ 1559 err = kstrtoul(buf, 10, &val); \
1560 if (err < 0) \ 1560 if (err < 0) \
1561 return err; \ 1561 return err; \
1562 val = SENSORS_LIMIT(val, 1, 255); \ 1562 val = SENSORS_LIMIT(val, 1, 255); \
@@ -1595,7 +1595,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
1595 int nr = sensor_attr->index; \ 1595 int nr = sensor_attr->index; \
1596 unsigned long val; \ 1596 unsigned long val; \
1597 int err; \ 1597 int err; \
1598 err = strict_strtoul(buf, 10, &val); \ 1598 err = kstrtoul(buf, 10, &val); \
1599 if (err < 0) \ 1599 if (err < 0) \
1600 return err; \ 1600 return err; \
1601 val = step_time_to_reg(val, data->pwm_mode[nr]); \ 1601 val = step_time_to_reg(val, data->pwm_mode[nr]); \
@@ -1702,7 +1702,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
1702 unsigned long val; 1702 unsigned long val;
1703 u16 reg, mask; 1703 u16 reg, mask;
1704 1704
1705 if (strict_strtoul(buf, 10, &val) || val != 0) 1705 if (kstrtoul(buf, 10, &val) || val != 0)
1706 return -EINVAL; 1706 return -EINVAL;
1707 1707
1708 mask = to_sensor_dev_attr_2(attr)->nr; 1708 mask = to_sensor_dev_attr_2(attr)->nr;
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index 8c2844e5691c..6e5d0ae594b0 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -711,7 +711,7 @@ static ssize_t store_pwm(struct device *dev, struct device_attribute *attr,
711 int nr = sensor_attr->index; 711 int nr = sensor_attr->index;
712 unsigned long val; 712 unsigned long val;
713 713
714 if (strict_strtoul(buf, 10, &val)) 714 if (kstrtoul(buf, 10, &val))
715 return -EINVAL; 715 return -EINVAL;
716 716
717 mutex_lock(&data->update_lock); 717 mutex_lock(&data->update_lock);
@@ -756,7 +756,7 @@ static ssize_t store_pwmenable(struct device *dev,
756 u8 val_shift = 0; 756 u8 val_shift = 0;
757 u8 keep_mask = 0; 757 u8 keep_mask = 0;
758 758
759 int ret = strict_strtoul(buf, 10, &val); 759 int ret = kstrtoul(buf, 10, &val);
760 760
761 if (ret || val < 1 || val > 3) 761 if (ret || val < 1 || val > 3)
762 return -EINVAL; 762 return -EINVAL;
@@ -819,7 +819,7 @@ static ssize_t store_temp_target(struct device *dev,
819 unsigned long val; 819 unsigned long val;
820 u8 target_mask; 820 u8 target_mask;
821 821
822 if (strict_strtoul(buf, 10, &val)) 822 if (kstrtoul(buf, 10, &val))
823 return -EINVAL; 823 return -EINVAL;
824 824
825 mutex_lock(&data->update_lock); 825 mutex_lock(&data->update_lock);
@@ -863,7 +863,7 @@ static ssize_t store_temp_tolerance(struct device *dev,
863 u8 val_shift = 0; 863 u8 val_shift = 0;
864 u8 keep_mask = 0; 864 u8 keep_mask = 0;
865 865
866 if (strict_strtoul(buf, 10, &val)) 866 if (kstrtoul(buf, 10, &val))
867 return -EINVAL; 867 return -EINVAL;
868 868
869 switch (nr) { 869 switch (nr) {
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index f3e7130c4cda..9ded133e43f0 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -749,7 +749,7 @@ store_chassis_clear(struct device *dev, struct device_attribute *attr,
749 unsigned long val; 749 unsigned long val;
750 u8 reg; 750 u8 reg;
751 751
752 if (strict_strtoul(buf, 10, &val) || val != 0) 752 if (kstrtoul(buf, 10, &val) || val != 0)
753 return -EINVAL; 753 return -EINVAL;
754 754
755 mutex_lock(&data->update_lock); 755 mutex_lock(&data->update_lock);
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 854f9117f1aa..3cc6fef22087 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -450,7 +450,7 @@ store_chassis_clear(struct device *dev,
450 unsigned long val; 450 unsigned long val;
451 u8 reg; 451 u8 reg;
452 452
453 if (strict_strtoul(buf, 10, &val) || val != 0) 453 if (kstrtoul(buf, 10, &val) || val != 0)
454 return -EINVAL; 454 return -EINVAL;
455 455
456 mutex_lock(&data->update_lock); 456 mutex_lock(&data->update_lock);
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c
index 845232d7f611..3ee398d0e4c9 100644
--- a/drivers/hwmon/w83795.c
+++ b/drivers/hwmon/w83795.c
@@ -730,7 +730,7 @@ store_beep(struct device *dev, struct device_attribute *attr,
730 u8 beep_bit = 1 << shift; 730 u8 beep_bit = 1 << shift;
731 unsigned long val; 731 unsigned long val;
732 732
733 if (strict_strtoul(buf, 10, &val) < 0) 733 if (kstrtoul(buf, 10, &val) < 0)
734 return -EINVAL; 734 return -EINVAL;
735 if (val != 0 && val != 1) 735 if (val != 0 && val != 1)
736 return -EINVAL; 736 return -EINVAL;
@@ -755,7 +755,7 @@ store_chassis_clear(struct device *dev,
755 struct w83795_data *data = i2c_get_clientdata(client); 755 struct w83795_data *data = i2c_get_clientdata(client);
756 unsigned long val; 756 unsigned long val;
757 757
758 if (strict_strtoul(buf, 10, &val) < 0 || val != 0) 758 if (kstrtoul(buf, 10, &val) < 0 || val != 0)
759 return -EINVAL; 759 return -EINVAL;
760 760
761 mutex_lock(&data->update_lock); 761 mutex_lock(&data->update_lock);
@@ -801,7 +801,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
801 struct w83795_data *data = i2c_get_clientdata(client); 801 struct w83795_data *data = i2c_get_clientdata(client);
802 unsigned long val; 802 unsigned long val;
803 803
804 if (strict_strtoul(buf, 10, &val)) 804 if (kstrtoul(buf, 10, &val))
805 return -EINVAL; 805 return -EINVAL;
806 val = fan_to_reg(val); 806 val = fan_to_reg(val);
807 807
@@ -863,7 +863,7 @@ store_pwm(struct device *dev, struct device_attribute *attr,
863 int index = sensor_attr->index; 863 int index = sensor_attr->index;
864 unsigned long val; 864 unsigned long val;
865 865
866 if (strict_strtoul(buf, 10, &val) < 0) 866 if (kstrtoul(buf, 10, &val) < 0)
867 return -EINVAL; 867 return -EINVAL;
868 868
869 mutex_lock(&data->update_lock); 869 mutex_lock(&data->update_lock);
@@ -924,7 +924,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
924 unsigned long val; 924 unsigned long val;
925 int i; 925 int i;
926 926
927 if (strict_strtoul(buf, 10, &val) < 0) 927 if (kstrtoul(buf, 10, &val) < 0)
928 return -EINVAL; 928 return -EINVAL;
929 if (val < 1 || val > 2) 929 if (val < 1 || val > 2)
930 return -EINVAL; 930 return -EINVAL;
@@ -1021,7 +1021,7 @@ store_temp_src(struct device *dev, struct device_attribute *attr,
1021 unsigned long channel; 1021 unsigned long channel;
1022 u8 val = index / 2; 1022 u8 val = index / 2;
1023 1023
1024 if (strict_strtoul(buf, 10, &channel) < 0 || 1024 if (kstrtoul(buf, 10, &channel) < 0 ||
1025 channel < 1 || channel > 14) 1025 channel < 1 || channel > 14)
1026 return -EINVAL; 1026 return -EINVAL;
1027 1027
@@ -1088,7 +1088,7 @@ store_temp_pwm_enable(struct device *dev, struct device_attribute *attr,
1088 int index = sensor_attr->index; 1088 int index = sensor_attr->index;
1089 unsigned long tmp; 1089 unsigned long tmp;
1090 1090
1091 if (strict_strtoul(buf, 10, &tmp) < 0) 1091 if (kstrtoul(buf, 10, &tmp) < 0)
1092 return -EINVAL; 1092 return -EINVAL;
1093 1093
1094 switch (nr) { 1094 switch (nr) {
@@ -1149,7 +1149,7 @@ store_fanin(struct device *dev, struct device_attribute *attr,
1149 int index = sensor_attr->index; 1149 int index = sensor_attr->index;
1150 unsigned long val; 1150 unsigned long val;
1151 1151
1152 if (strict_strtoul(buf, 10, &val) < 0) 1152 if (kstrtoul(buf, 10, &val) < 0)
1153 return -EINVAL; 1153 return -EINVAL;
1154 1154
1155 mutex_lock(&data->update_lock); 1155 mutex_lock(&data->update_lock);
@@ -1198,7 +1198,7 @@ store_temp_pwm(struct device *dev, struct device_attribute *attr,
1198 unsigned long val; 1198 unsigned long val;
1199 u8 tmp; 1199 u8 tmp;
1200 1200
1201 if (strict_strtoul(buf, 10, &val) < 0) 1201 if (kstrtoul(buf, 10, &val) < 0)
1202 return -EINVAL; 1202 return -EINVAL;
1203 val /= 1000; 1203 val /= 1000;
1204 1204
@@ -1257,7 +1257,7 @@ store_sf4_pwm(struct device *dev, struct device_attribute *attr,
1257 int index = sensor_attr->index; 1257 int index = sensor_attr->index;
1258 unsigned long val; 1258 unsigned long val;
1259 1259
1260 if (strict_strtoul(buf, 10, &val) < 0) 1260 if (kstrtoul(buf, 10, &val) < 0)
1261 return -EINVAL; 1261 return -EINVAL;
1262 1262
1263 mutex_lock(&data->update_lock); 1263 mutex_lock(&data->update_lock);
@@ -1293,7 +1293,7 @@ store_sf4_temp(struct device *dev, struct device_attribute *attr,
1293 int index = sensor_attr->index; 1293 int index = sensor_attr->index;
1294 unsigned long val; 1294 unsigned long val;
1295 1295
1296 if (strict_strtoul(buf, 10, &val) < 0) 1296 if (kstrtoul(buf, 10, &val) < 0)
1297 return -EINVAL; 1297 return -EINVAL;
1298 val /= 1000; 1298 val /= 1000;
1299 1299
@@ -1333,7 +1333,7 @@ store_temp(struct device *dev, struct device_attribute *attr,
1333 struct w83795_data *data = i2c_get_clientdata(client); 1333 struct w83795_data *data = i2c_get_clientdata(client);
1334 long tmp; 1334 long tmp;
1335 1335
1336 if (strict_strtol(buf, 10, &tmp) < 0) 1336 if (kstrtol(buf, 10, &tmp) < 0)
1337 return -EINVAL; 1337 return -EINVAL;
1338 1338
1339 mutex_lock(&data->update_lock); 1339 mutex_lock(&data->update_lock);
@@ -1394,7 +1394,7 @@ store_dts_ext(struct device *dev, struct device_attribute *attr,
1394 struct w83795_data *data = i2c_get_clientdata(client); 1394 struct w83795_data *data = i2c_get_clientdata(client);
1395 long tmp; 1395 long tmp;
1396 1396
1397 if (strict_strtol(buf, 10, &tmp) < 0) 1397 if (kstrtol(buf, 10, &tmp) < 0)
1398 return -EINVAL; 1398 return -EINVAL;
1399 1399
1400 mutex_lock(&data->update_lock); 1400 mutex_lock(&data->update_lock);
@@ -1436,7 +1436,7 @@ store_temp_mode(struct device *dev, struct device_attribute *attr,
1436 unsigned long val; 1436 unsigned long val;
1437 u8 tmp; 1437 u8 tmp;
1438 1438
1439 if (strict_strtoul(buf, 10, &val) < 0) 1439 if (kstrtoul(buf, 10, &val) < 0)
1440 return -EINVAL; 1440 return -EINVAL;
1441 if ((val != 4) && (val != 3)) 1441 if ((val != 4) && (val != 3))
1442 return -EINVAL; 1442 return -EINVAL;
@@ -1512,7 +1512,7 @@ store_in(struct device *dev, struct device_attribute *attr,
1512 u8 tmp; 1512 u8 tmp;
1513 u8 lsb_idx; 1513 u8 lsb_idx;
1514 1514
1515 if (strict_strtoul(buf, 10, &val) < 0) 1515 if (kstrtoul(buf, 10, &val) < 0)
1516 return -EINVAL; 1516 return -EINVAL;
1517 val = in_to_reg(index, val); 1517 val = in_to_reg(index, val);
1518 1518
@@ -1569,7 +1569,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,
1569 struct w83795_data *data = i2c_get_clientdata(client); 1569 struct w83795_data *data = i2c_get_clientdata(client);
1570 unsigned long val; 1570 unsigned long val;
1571 1571
1572 if (strict_strtoul(buf, 10, &val) < 0) 1572 if (kstrtoul(buf, 10, &val) < 0)
1573 return -EINVAL; 1573 return -EINVAL;
1574 1574
1575 switch (nr) { 1575 switch (nr) {