提交 179c4fdb 编写于 作者: F Frans Meulenbroeks 提交者: Guenter Roeck

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: NFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: NGuenter Roeck <guenter.roeck@ericsson.com>
上级 24edc0a7
...@@ -170,7 +170,7 @@ static ssize_t set_avg_interval(struct device *dev, ...@@ -170,7 +170,7 @@ static ssize_t set_avg_interval(struct device *dev,
unsigned long long data; unsigned long long data;
acpi_status status; acpi_status status;
res = strict_strtoul(buf, 10, &temp); res = kstrtoul(buf, 10, &temp);
if (res) if (res)
return res; return res;
...@@ -241,7 +241,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr, ...@@ -241,7 +241,7 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr,
unsigned long long data; unsigned long long data;
acpi_status status; acpi_status status;
res = strict_strtoul(buf, 10, &temp); res = kstrtoul(buf, 10, &temp);
if (res) if (res)
return res; return res;
...@@ -311,7 +311,7 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr, ...@@ -311,7 +311,7 @@ static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,
int res; int res;
unsigned long temp; unsigned long temp;
res = strict_strtoul(buf, 10, &temp); res = kstrtoul(buf, 10, &temp);
if (res) if (res)
return res; return res;
......
...@@ -125,7 +125,7 @@ static ssize_t adcxx_set_max(struct device *dev, ...@@ -125,7 +125,7 @@ static ssize_t adcxx_set_max(struct device *dev,
struct adcxx *adc = spi_get_drvdata(spi); struct adcxx *adc = spi_get_drvdata(spi);
unsigned long value; unsigned long value;
if (strict_strtoul(buf, 10, &value)) if (kstrtoul(buf, 10, &value))
return -EINVAL; return -EINVAL;
if (mutex_lock_interruptible(&adc->lock)) if (mutex_lock_interruptible(&adc->lock))
......
...@@ -767,7 +767,7 @@ static ssize_t set_update_interval(struct device *dev, ...@@ -767,7 +767,7 @@ static ssize_t set_update_interval(struct device *dev,
int i, err; int i, err;
u8 reg; u8 reg;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
......
...@@ -503,7 +503,7 @@ static ssize_t chassis_clear(struct device *dev, ...@@ -503,7 +503,7 @@ static ssize_t chassis_clear(struct device *dev,
struct adm9240_data *data = i2c_get_clientdata(client); struct adm9240_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) || val != 0) if (kstrtoul(buf, 10, &val) || val != 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
......
...@@ -197,7 +197,7 @@ static ssize_t adt7411_set_bit(struct device *dev, ...@@ -197,7 +197,7 @@ static ssize_t adt7411_set_bit(struct device *dev,
int ret; int ret;
unsigned long flag; unsigned long flag;
ret = strict_strtoul(buf, 0, &flag); ret = kstrtoul(buf, 0, &flag);
if (ret || flag > 1) if (ret || flag > 1)
return -EINVAL; return -EINVAL;
......
...@@ -833,7 +833,7 @@ static ssize_t set_temp_min(struct device *dev, ...@@ -833,7 +833,7 @@ static ssize_t set_temp_min(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
...@@ -871,7 +871,7 @@ static ssize_t set_temp_max(struct device *dev, ...@@ -871,7 +871,7 @@ static ssize_t set_temp_max(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !temp_enabled(data, attr->index)) if (kstrtol(buf, 10, &temp) || !temp_enabled(data, attr->index))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
...@@ -935,7 +935,7 @@ static ssize_t set_volt_max(struct device *dev, ...@@ -935,7 +935,7 @@ static ssize_t set_volt_max(struct device *dev,
int x = voltage_multiplier(data, attr->index); int x = voltage_multiplier(data, attr->index);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !x) if (kstrtol(buf, 10, &temp) || !x)
return -EINVAL; return -EINVAL;
temp *= 1000; /* convert mV to uV */ temp *= 1000; /* convert mV to uV */
...@@ -977,7 +977,7 @@ static ssize_t set_volt_min(struct device *dev, ...@@ -977,7 +977,7 @@ static ssize_t set_volt_min(struct device *dev,
int x = voltage_multiplier(data, attr->index); int x = voltage_multiplier(data, attr->index);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !x) if (kstrtol(buf, 10, &temp) || !x)
return -EINVAL; return -EINVAL;
temp *= 1000; /* convert mV to uV */ temp *= 1000; /* convert mV to uV */
...@@ -1066,7 +1066,7 @@ static ssize_t set_fan_min(struct device *dev, ...@@ -1066,7 +1066,7 @@ static ssize_t set_fan_min(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !temp || if (kstrtol(buf, 10, &temp) || !temp ||
!fan_enabled(data, attr->index)) !fan_enabled(data, attr->index))
return -EINVAL; return -EINVAL;
...@@ -1115,7 +1115,7 @@ static ssize_t set_force_pwm_max(struct device *dev, ...@@ -1115,7 +1115,7 @@ static ssize_t set_force_pwm_max(struct device *dev,
long temp; long temp;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -1147,7 +1147,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr, ...@@ -1147,7 +1147,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -1177,7 +1177,7 @@ static ssize_t set_pwm_max(struct device *dev, ...@@ -1177,7 +1177,7 @@ static ssize_t set_pwm_max(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -1209,7 +1209,7 @@ static ssize_t set_pwm_min(struct device *dev, ...@@ -1209,7 +1209,7 @@ static ssize_t set_pwm_min(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -1243,7 +1243,7 @@ static ssize_t set_pwm_hyst(struct device *dev, ...@@ -1243,7 +1243,7 @@ static ssize_t set_pwm_hyst(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000); temp = DIV_ROUND_CLOSEST(temp, 1000);
...@@ -1289,7 +1289,7 @@ static ssize_t set_pwm_tmax(struct device *dev, ...@@ -1289,7 +1289,7 @@ static ssize_t set_pwm_tmax(struct device *dev,
int tmin, trange_value; int tmin, trange_value;
long trange; long trange;
if (strict_strtol(buf, 10, &trange)) if (kstrtol(buf, 10, &trange))
return -EINVAL; return -EINVAL;
/* trange = tmax - tmin */ /* trange = tmax - tmin */
...@@ -1330,7 +1330,7 @@ static ssize_t set_pwm_tmin(struct device *dev, ...@@ -1330,7 +1330,7 @@ static ssize_t set_pwm_tmin(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000) + 64; temp = DIV_ROUND_CLOSEST(temp, 1000) + 64;
...@@ -1387,7 +1387,7 @@ static ssize_t set_pwm_auto(struct device *dev, ...@@ -1387,7 +1387,7 @@ static ssize_t set_pwm_auto(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
switch (temp) { switch (temp) {
...@@ -1446,7 +1446,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev, ...@@ -1446,7 +1446,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev,
struct adt7462_data *data = i2c_get_clientdata(client); struct adt7462_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = cvt_auto_temp(temp); temp = cvt_auto_temp(temp);
......
...@@ -449,7 +449,7 @@ static ssize_t set_auto_update_interval(struct device *dev, ...@@ -449,7 +449,7 @@ static ssize_t set_auto_update_interval(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 60000); temp = SENSORS_LIMIT(temp, 0, 60000);
...@@ -478,7 +478,7 @@ static ssize_t set_num_temp_sensors(struct device *dev, ...@@ -478,7 +478,7 @@ static ssize_t set_num_temp_sensors(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, -1, 10); temp = SENSORS_LIMIT(temp, -1, 10);
...@@ -511,7 +511,7 @@ static ssize_t set_temp_min(struct device *dev, ...@@ -511,7 +511,7 @@ static ssize_t set_temp_min(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000); temp = DIV_ROUND_CLOSEST(temp, 1000);
...@@ -545,7 +545,7 @@ static ssize_t set_temp_max(struct device *dev, ...@@ -545,7 +545,7 @@ static ssize_t set_temp_max(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000); temp = DIV_ROUND_CLOSEST(temp, 1000);
...@@ -600,7 +600,7 @@ static ssize_t set_fan_max(struct device *dev, ...@@ -600,7 +600,7 @@ static ssize_t set_fan_max(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !temp) if (kstrtol(buf, 10, &temp) || !temp)
return -EINVAL; return -EINVAL;
temp = FAN_RPM_TO_PERIOD(temp); temp = FAN_RPM_TO_PERIOD(temp);
...@@ -637,7 +637,7 @@ static ssize_t set_fan_min(struct device *dev, ...@@ -637,7 +637,7 @@ static ssize_t set_fan_min(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp) || !temp) if (kstrtol(buf, 10, &temp) || !temp)
return -EINVAL; return -EINVAL;
temp = FAN_RPM_TO_PERIOD(temp); temp = FAN_RPM_TO_PERIOD(temp);
...@@ -682,7 +682,7 @@ static ssize_t set_force_pwm_max(struct device *dev, ...@@ -682,7 +682,7 @@ static ssize_t set_force_pwm_max(struct device *dev,
long temp; long temp;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -714,7 +714,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr, ...@@ -714,7 +714,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -746,7 +746,7 @@ static ssize_t set_pwm_max(struct device *dev, ...@@ -746,7 +746,7 @@ static ssize_t set_pwm_max(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -779,7 +779,7 @@ static ssize_t set_pwm_min(struct device *dev, ...@@ -779,7 +779,7 @@ static ssize_t set_pwm_min(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = SENSORS_LIMIT(temp, 0, 255); temp = SENSORS_LIMIT(temp, 0, 255);
...@@ -822,7 +822,7 @@ static ssize_t set_pwm_tmin(struct device *dev, ...@@ -822,7 +822,7 @@ static ssize_t set_pwm_tmin(struct device *dev,
struct adt7470_data *data = i2c_get_clientdata(client); struct adt7470_data *data = i2c_get_clientdata(client);
long temp; long temp;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = DIV_ROUND_CLOSEST(temp, 1000); temp = DIV_ROUND_CLOSEST(temp, 1000);
...@@ -859,7 +859,7 @@ static ssize_t set_pwm_auto(struct device *dev, ...@@ -859,7 +859,7 @@ static ssize_t set_pwm_auto(struct device *dev,
long temp; long temp;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
if (attr->index % 2) if (attr->index % 2)
...@@ -919,7 +919,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev, ...@@ -919,7 +919,7 @@ static ssize_t set_pwm_auto_temp(struct device *dev,
long temp; long temp;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &temp)) if (kstrtol(buf, 10, &temp))
return -EINVAL; return -EINVAL;
temp = cvt_auto_temp(temp); temp = cvt_auto_temp(temp);
......
...@@ -343,7 +343,7 @@ static ssize_t set_voltage(struct device *dev, struct device_attribute *attr, ...@@ -343,7 +343,7 @@ static ssize_t set_voltage(struct device *dev, struct device_attribute *attr,
unsigned char reg; unsigned char reg;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -432,7 +432,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *attr, ...@@ -432,7 +432,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *attr,
int temp; int temp;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -546,7 +546,7 @@ static ssize_t set_point2(struct device *dev, struct device_attribute *attr, ...@@ -546,7 +546,7 @@ static ssize_t set_point2(struct device *dev, struct device_attribute *attr,
int temp; int temp;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -602,7 +602,7 @@ static ssize_t set_tach(struct device *dev, struct device_attribute *attr, ...@@ -602,7 +602,7 @@ static ssize_t set_tach(struct device *dev, struct device_attribute *attr,
struct adt7475_data *data = i2c_get_clientdata(client); struct adt7475_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -653,7 +653,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, ...@@ -653,7 +653,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
unsigned char reg = 0; unsigned char reg = 0;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -758,7 +758,7 @@ static ssize_t set_pwmchan(struct device *dev, struct device_attribute *attr, ...@@ -758,7 +758,7 @@ static ssize_t set_pwmchan(struct device *dev, struct device_attribute *attr,
int r; int r;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -781,7 +781,7 @@ static ssize_t set_pwmctrl(struct device *dev, struct device_attribute *attr, ...@@ -781,7 +781,7 @@ static ssize_t set_pwmctrl(struct device *dev, struct device_attribute *attr,
int r; int r;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -819,7 +819,7 @@ static ssize_t set_pwmfreq(struct device *dev, struct device_attribute *attr, ...@@ -819,7 +819,7 @@ static ssize_t set_pwmfreq(struct device *dev, struct device_attribute *attr,
int out; int out;
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
out = find_nearest(val, pwmfreq_table, ARRAY_SIZE(pwmfreq_table)); 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,7 +853,7 @@ static ssize_t set_pwm_at_crit(struct device *dev,
struct adt7475_data *data = i2c_get_clientdata(client); struct adt7475_data *data = i2c_get_clientdata(client);
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
if (val != 0 && val != 1) if (val != 0 && val != 1)
return -EINVAL; return -EINVAL;
...@@ -883,7 +883,7 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *devattr, ...@@ -883,7 +883,7 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *devattr,
struct adt7475_data *data = dev_get_drvdata(dev); struct adt7475_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
if (val < 0 || val > 255) if (val < 0 || val > 255)
return -EINVAL; return -EINVAL;
......
...@@ -238,7 +238,7 @@ static ssize_t set_temp( ...@@ -238,7 +238,7 @@ static ssize_t set_temp(
int ix = to_sensor_dev_attr(attr)->index; int ix = to_sensor_dev_attr(attr)->index;
long val; long val;
int ret = strict_strtol(buf, 10, &val); int ret = kstrtol(buf, 10, &val);
if (ret) if (ret)
return ret; return ret;
val = SENSORS_LIMIT(val / 1000, -128, 127); val = SENSORS_LIMIT(val / 1000, -128, 127);
...@@ -327,7 +327,7 @@ static ssize_t set_pwm1( ...@@ -327,7 +327,7 @@ static ssize_t set_pwm1(
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct amc6821_data *data = i2c_get_clientdata(client); struct amc6821_data *data = i2c_get_clientdata(client);
long val; long val;
int ret = strict_strtol(buf, 10, &val); int ret = kstrtol(buf, 10, &val);
if (ret) if (ret)
return ret; return ret;
...@@ -356,7 +356,7 @@ static ssize_t set_pwm1_enable( ...@@ -356,7 +356,7 @@ static ssize_t set_pwm1_enable(
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct amc6821_data *data = i2c_get_clientdata(client); struct amc6821_data *data = i2c_get_clientdata(client);
long val; long val;
int config = strict_strtol(buf, 10, &val); int config = kstrtol(buf, 10, &val);
if (config) if (config)
return config; return config;
...@@ -477,7 +477,7 @@ static ssize_t set_temp_auto_point_temp( ...@@ -477,7 +477,7 @@ static ssize_t set_temp_auto_point_temp(
u8 reg; u8 reg;
int dpwm; int dpwm;
long val; long val;
int ret = strict_strtol(buf, 10, &val); int ret = kstrtol(buf, 10, &val);
if (ret) if (ret)
return ret; return ret;
...@@ -556,7 +556,7 @@ static ssize_t set_pwm1_auto_point_pwm( ...@@ -556,7 +556,7 @@ static ssize_t set_pwm1_auto_point_pwm(
struct amc6821_data *data = i2c_get_clientdata(client); struct amc6821_data *data = i2c_get_clientdata(client);
int dpwm; int dpwm;
long val; long val;
int ret = strict_strtol(buf, 10, &val); int ret = kstrtol(buf, 10, &val);
if (ret) if (ret)
return ret; return ret;
...@@ -623,7 +623,7 @@ static ssize_t set_fan( ...@@ -623,7 +623,7 @@ static ssize_t set_fan(
struct amc6821_data *data = i2c_get_clientdata(client); struct amc6821_data *data = i2c_get_clientdata(client);
long val; long val;
int ix = to_sensor_dev_attr(attr)->index; int ix = to_sensor_dev_attr(attr)->index;
int ret = strict_strtol(buf, 10, &val); int ret = kstrtol(buf, 10, &val);
if (ret) if (ret)
return ret; return ret;
val = 1 > val ? 0xFFFF : 6000000/val; val = 1 > val ? 0xFFFF : 6000000/val;
...@@ -665,7 +665,7 @@ static ssize_t set_fan1_div( ...@@ -665,7 +665,7 @@ static ssize_t set_fan1_div(
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct amc6821_data *data = i2c_get_clientdata(client); struct amc6821_data *data = i2c_get_clientdata(client);
long val; long val;
int config = strict_strtol(buf, 10, &val); int config = kstrtol(buf, 10, &val);
if (config) if (config)
return config; return config;
......
...@@ -782,7 +782,7 @@ static ssize_t applesmc_store_fan_speed(struct device *dev, ...@@ -782,7 +782,7 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
char newkey[5]; char newkey[5];
u8 buffer[2]; u8 buffer[2];
if (strict_strtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000) if (kstrtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000)
return -EINVAL; /* Bigger than a 14-bit value */ return -EINVAL; /* Bigger than a 14-bit value */
sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr)); 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,7 +822,7 @@ static ssize_t applesmc_store_fan_manual(struct device *dev,
unsigned long input; unsigned long input;
u16 val; u16 val;
if (strict_strtoul(sysfsbuf, 10, &input) < 0) if (kstrtoul(sysfsbuf, 10, &input) < 0)
return -EINVAL; return -EINVAL;
ret = applesmc_read_key(FANS_MANUAL, buffer, 2); ret = applesmc_read_key(FANS_MANUAL, buffer, 2);
...@@ -977,7 +977,7 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, ...@@ -977,7 +977,7 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
{ {
unsigned long newkey; unsigned long newkey;
if (strict_strtoul(sysfsbuf, 10, &newkey) < 0 if (kstrtoul(sysfsbuf, 10, &newkey) < 0
|| newkey >= smcreg.key_count) || newkey >= smcreg.key_count)
return -EINVAL; return -EINVAL;
......
...@@ -188,7 +188,7 @@ static ssize_t store_u8(struct device *dev, struct device_attribute *attr, ...@@ -188,7 +188,7 @@ static ssize_t store_u8(struct device *dev, struct device_attribute *attr,
SETUP_STORE_data_param(dev, attr); SETUP_STORE_data_param(dev, attr);
long reqval; long reqval;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
reqval = SENSORS_LIMIT(reqval, 0, 255); reqval = SENSORS_LIMIT(reqval, 0, 255);
...@@ -221,7 +221,7 @@ static ssize_t store_bitmask(struct device *dev, ...@@ -221,7 +221,7 @@ static ssize_t store_bitmask(struct device *dev,
long reqval; long reqval;
u8 currval; u8 currval;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
reqval = SENSORS_LIMIT(reqval, 0, param->mask[0]); reqval = SENSORS_LIMIT(reqval, 0, param->mask[0]);
...@@ -265,7 +265,7 @@ static ssize_t store_fan16(struct device *dev, ...@@ -265,7 +265,7 @@ static ssize_t store_fan16(struct device *dev,
SETUP_STORE_data_param(dev, attr); SETUP_STORE_data_param(dev, attr);
long reqval; long reqval;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
/* If a minimum RPM of zero is requested, then we set the register to /* 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,7 +338,7 @@ static ssize_t store_in8(struct device *dev, struct device_attribute *attr,
long reqval; long reqval;
u8 nr = sda->index; u8 nr = sda->index;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
reqval = SENSORS_LIMIT(reqval, 0, 0xffff); reqval = SENSORS_LIMIT(reqval, 0, 0xffff);
...@@ -371,7 +371,7 @@ static ssize_t store_temp8(struct device *dev, ...@@ -371,7 +371,7 @@ static ssize_t store_temp8(struct device *dev,
long reqval; long reqval;
s8 temp; s8 temp;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
reqval = SENSORS_LIMIT(reqval, -127000, 127000); reqval = SENSORS_LIMIT(reqval, -127000, 127000);
...@@ -427,7 +427,7 @@ static ssize_t store_temp62(struct device *dev, ...@@ -427,7 +427,7 @@ static ssize_t store_temp62(struct device *dev,
long reqval, i, f; long reqval, i, f;
s8 temp; s8 temp;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
reqval = SENSORS_LIMIT(reqval, -32000, 31750); reqval = SENSORS_LIMIT(reqval, -32000, 31750);
...@@ -482,7 +482,7 @@ static ssize_t store_ap2_temp(struct device *dev, ...@@ -482,7 +482,7 @@ static ssize_t store_ap2_temp(struct device *dev,
int i; int i;
u8 currval, newval = 0; u8 currval, newval = 0;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -538,7 +538,7 @@ static ssize_t store_pwm_ac(struct device *dev, ...@@ -538,7 +538,7 @@ static ssize_t store_pwm_ac(struct device *dev,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
}; };
if (strict_strtoul(buf, 10, &reqval)) if (kstrtoul(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
if (reqval > 31) if (reqval > 31)
...@@ -601,7 +601,7 @@ static ssize_t store_pwm_enable(struct device *dev, ...@@ -601,7 +601,7 @@ static ssize_t store_pwm_enable(struct device *dev,
long reqval; long reqval;
u8 currval, config, altbit, newval, minoff = 255; u8 currval, config, altbit, newval, minoff = 255;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
switch (reqval) { switch (reqval) {
...@@ -675,7 +675,7 @@ static ssize_t store_pwm_freq(struct device *dev, ...@@ -675,7 +675,7 @@ static ssize_t store_pwm_freq(struct device *dev,
u8 currval, newval = 255; u8 currval, newval = 255;
int i; int i;
if (strict_strtoul(buf, 10, &reqval)) if (kstrtoul(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
for (i = 0; i < ARRAY_SIZE(asc7621_pwm_freq_map); i++) { 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,7 +724,7 @@ static ssize_t store_pwm_ast(struct device *dev,
u8 currval, newval = 255; u8 currval, newval = 255;
u32 i; u32 i;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
for (i = 0; i < ARRAY_SIZE(asc7621_pwm_auto_spinup_map); i++) { 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,7 +771,7 @@ static ssize_t store_temp_st(struct device *dev,
u8 currval, newval = 255; u8 currval, newval = 255;
u32 i; u32 i;
if (strict_strtol(buf, 10, &reqval)) if (kstrtol(buf, 10, &reqval))
return -EINVAL; return -EINVAL;
for (i = 0; i < ARRAY_SIZE(asc7621_temp_smoothing_time_map); i++) { for (i = 0; i < ARRAY_SIZE(asc7621_temp_smoothing_time_map); i++) {
......
...@@ -161,7 +161,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da, ...@@ -161,7 +161,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct ds620_data *data = i2c_get_clientdata(client); struct ds620_data *data = i2c_get_clientdata(client);
res = strict_strtol(buf, 10, &val); res = kstrtol(buf, 10, &val);
if (res) if (res)
return res; return res;
......
...@@ -80,7 +80,7 @@ static ssize_t store_temp(struct device *dev, ...@@ -80,7 +80,7 @@ static ssize_t store_temp(struct device *dev,
unsigned long val; unsigned long val;
int retval; int retval;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
retval = i2c_smbus_write_byte_data(client, sda->index, retval = i2c_smbus_write_byte_data(client, sda->index,
DIV_ROUND_CLOSEST(val, 1000)); DIV_ROUND_CLOSEST(val, 1000));
...@@ -98,7 +98,7 @@ static ssize_t store_bit(struct device *dev, ...@@ -98,7 +98,7 @@ static ssize_t store_bit(struct device *dev,
unsigned long val; unsigned long val;
int retval; int retval;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->mutex); mutex_lock(&data->mutex);
...@@ -151,7 +151,7 @@ static ssize_t store_hyst(struct device *dev, ...@@ -151,7 +151,7 @@ static ssize_t store_hyst(struct device *dev,
int hyst; int hyst;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->mutex); mutex_lock(&data->mutex);
......
...@@ -244,7 +244,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da, ...@@ -244,7 +244,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da,
struct emc2103_data *data = i2c_get_clientdata(client); struct emc2103_data *data = i2c_get_clientdata(client);
long val; long val;
int result = strict_strtol(buf, 10, &val); int result = kstrtol(buf, 10, &val);
if (result < 0) if (result < 0)
return -EINVAL; return -EINVAL;
...@@ -268,7 +268,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da, ...@@ -268,7 +268,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da,
struct emc2103_data *data = i2c_get_clientdata(client); struct emc2103_data *data = i2c_get_clientdata(client);
long val; long val;
int result = strict_strtol(buf, 10, &val); int result = kstrtol(buf, 10, &val);
if (result < 0) if (result < 0)
return -EINVAL; return -EINVAL;
...@@ -314,7 +314,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da, ...@@ -314,7 +314,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,
int new_range_bits, old_div = 8 / data->fan_multiplier; int new_range_bits, old_div = 8 / data->fan_multiplier;
long new_div; long new_div;
int status = strict_strtol(buf, 10, &new_div); int status = kstrtol(buf, 10, &new_div);
if (status < 0) if (status < 0)
return -EINVAL; return -EINVAL;
...@@ -388,7 +388,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da, ...@@ -388,7 +388,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da,
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
long rpm_target; long rpm_target;
int result = strict_strtol(buf, 10, &rpm_target); int result = kstrtol(buf, 10, &rpm_target);
if (result < 0) if (result < 0)
return -EINVAL; return -EINVAL;
...@@ -434,7 +434,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, ...@@ -434,7 +434,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,
long new_value; long new_value;
u8 conf_reg; u8 conf_reg;
int result = strict_strtol(buf, 10, &new_value); int result = kstrtol(buf, 10, &new_value);
if (result < 0) if (result < 0)
return -EINVAL; return -EINVAL;
......
...@@ -212,7 +212,7 @@ static ssize_t set_in(struct device *dev, struct device_attribute *devattr, ...@@ -212,7 +212,7 @@ static ssize_t set_in(struct device *dev, struct device_attribute *devattr,
long val; long val;
u8 reg; u8 reg;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -249,7 +249,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr, ...@@ -249,7 +249,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
long val; long val;
u8 reg; u8 reg;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -291,7 +291,7 @@ static ssize_t set_fan(struct device *dev, struct device_attribute *devattr, ...@@ -291,7 +291,7 @@ static ssize_t set_fan(struct device *dev, struct device_attribute *devattr,
int err; int err;
unsigned long val; unsigned long val;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -1333,7 +1333,7 @@ static ssize_t store_fan_full_speed(struct device *dev, ...@@ -1333,7 +1333,7 @@ static ssize_t store_fan_full_speed(struct device *dev,
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1367,7 +1367,7 @@ static ssize_t store_fan_beep(struct device *dev, struct device_attribute ...@@ -1367,7 +1367,7 @@ static ssize_t store_fan_beep(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
unsigned long val; unsigned long val;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1420,7 +1420,7 @@ static ssize_t store_in_max(struct device *dev, struct device_attribute ...@@ -1420,7 +1420,7 @@ static ssize_t store_in_max(struct device *dev, struct device_attribute
int err; int err;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1454,7 +1454,7 @@ static ssize_t store_in_beep(struct device *dev, struct device_attribute ...@@ -1454,7 +1454,7 @@ static ssize_t store_in_beep(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
unsigned long val; unsigned long val;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1524,7 +1524,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute ...@@ -1524,7 +1524,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1566,7 +1566,7 @@ static ssize_t store_temp_max_hyst(struct device *dev, struct device_attribute ...@@ -1566,7 +1566,7 @@ static ssize_t store_temp_max_hyst(struct device *dev, struct device_attribute
u8 reg; u8 reg;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1609,7 +1609,7 @@ static ssize_t store_temp_crit(struct device *dev, struct device_attribute ...@@ -1609,7 +1609,7 @@ static ssize_t store_temp_crit(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1670,7 +1670,7 @@ static ssize_t store_temp_beep(struct device *dev, struct device_attribute ...@@ -1670,7 +1670,7 @@ static ssize_t store_temp_beep(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
unsigned long val; unsigned long val;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1737,7 +1737,7 @@ static ssize_t store_pwm(struct device *dev, ...@@ -1737,7 +1737,7 @@ static ssize_t store_pwm(struct device *dev,
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1788,7 +1788,7 @@ static ssize_t store_simple_pwm(struct device *dev, ...@@ -1788,7 +1788,7 @@ static ssize_t store_simple_pwm(struct device *dev,
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1835,7 +1835,7 @@ static ssize_t store_pwm_enable(struct device *dev, struct device_attribute ...@@ -1835,7 +1835,7 @@ static ssize_t store_pwm_enable(struct device *dev, struct device_attribute
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1915,7 +1915,7 @@ static ssize_t store_pwm_auto_point_pwm(struct device *dev, ...@@ -1915,7 +1915,7 @@ static ssize_t store_pwm_auto_point_pwm(struct device *dev,
int point = to_sensor_dev_attr_2(devattr)->nr; int point = to_sensor_dev_attr_2(devattr)->nr;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1969,7 +1969,7 @@ static ssize_t store_pwm_auto_point_temp_hyst(struct device *dev, ...@@ -1969,7 +1969,7 @@ static ssize_t store_pwm_auto_point_temp_hyst(struct device *dev,
u8 reg; u8 reg;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -2015,7 +2015,7 @@ static ssize_t store_pwm_interpolate(struct device *dev, ...@@ -2015,7 +2015,7 @@ static ssize_t store_pwm_interpolate(struct device *dev,
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
unsigned long val; unsigned long val;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -2055,7 +2055,7 @@ static ssize_t store_pwm_auto_point_channel(struct device *dev, ...@@ -2055,7 +2055,7 @@ static ssize_t store_pwm_auto_point_channel(struct device *dev,
int err, nr = to_sensor_dev_attr_2(devattr)->index; int err, nr = to_sensor_dev_attr_2(devattr)->index;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -2106,7 +2106,7 @@ static ssize_t store_pwm_auto_point_temp(struct device *dev, ...@@ -2106,7 +2106,7 @@ static ssize_t store_pwm_auto_point_temp(struct device *dev,
int point = to_sensor_dev_attr_2(devattr)->nr; int point = to_sensor_dev_attr_2(devattr)->nr;
long val; long val;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err) if (err)
return err; return err;
......
...@@ -166,7 +166,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *da, ...@@ -166,7 +166,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *da,
struct g760a_data *data = g760a_update_client(dev); struct g760a_data *data = g760a_update_client(dev);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
......
...@@ -224,7 +224,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, ...@@ -224,7 +224,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
int speed_index; int speed_index;
int ret = count; int ret = count;
if (strict_strtoul(buf, 10, &pwm) || pwm > 255) if (kstrtoul(buf, 10, &pwm) || pwm > 255)
return -EINVAL; return -EINVAL;
mutex_lock(&fan_data->lock); mutex_lock(&fan_data->lock);
...@@ -257,7 +257,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr, ...@@ -257,7 +257,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
struct gpio_fan_data *fan_data = dev_get_drvdata(dev); struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) || val > 1) if (kstrtoul(buf, 10, &val) || val > 1)
return -EINVAL; return -EINVAL;
if (fan_data->pwm_enable == val) if (fan_data->pwm_enable == val)
...@@ -314,7 +314,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr, ...@@ -314,7 +314,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr,
unsigned long rpm; unsigned long rpm;
int ret = count; int ret = count;
if (strict_strtoul(buf, 10, &rpm)) if (kstrtoul(buf, 10, &rpm))
return -EINVAL; return -EINVAL;
mutex_lock(&fan_data->lock); mutex_lock(&fan_data->lock);
......
...@@ -904,7 +904,7 @@ static ssize_t aem_set_power_period(struct device *dev, ...@@ -904,7 +904,7 @@ static ssize_t aem_set_power_period(struct device *dev,
unsigned long temp; unsigned long temp;
int res; int res;
res = strict_strtoul(buf, 10, &temp); res = kstrtoul(buf, 10, &temp);
if (res) if (res)
return res; return res;
......
...@@ -444,7 +444,7 @@ static ssize_t set_in_min(struct device *dev, struct device_attribute *attr, ...@@ -444,7 +444,7 @@ static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -463,7 +463,7 @@ static ssize_t set_in_max(struct device *dev, struct device_attribute *attr, ...@@ -463,7 +463,7 @@ static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -539,7 +539,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, ...@@ -539,7 +539,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -557,7 +557,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, ...@@ -557,7 +557,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -604,7 +604,7 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr, ...@@ -604,7 +604,7 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr,
long val; long val;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
reg = it87_read_value(data, IT87_REG_TEMP_ENABLE); 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,7 +718,7 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
long val; long val;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -751,7 +751,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, ...@@ -751,7 +751,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
int min; int min;
u8 old; u8 old;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -820,7 +820,7 @@ static ssize_t set_pwm_enable(struct device *dev, ...@@ -820,7 +820,7 @@ static ssize_t set_pwm_enable(struct device *dev,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 2) if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 2)
return -EINVAL; return -EINVAL;
/* Check trip points before switching to automatic mode */ /* 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,7 +866,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 255) if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 255)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -900,7 +900,7 @@ static ssize_t set_pwm_freq(struct device *dev, ...@@ -900,7 +900,7 @@ static ssize_t set_pwm_freq(struct device *dev,
unsigned long val; unsigned long val;
int i; int i;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
/* Search for the nearest available frequency */ /* Search for the nearest available frequency */
...@@ -949,7 +949,7 @@ static ssize_t set_pwm_temp_map(struct device *dev, ...@@ -949,7 +949,7 @@ static ssize_t set_pwm_temp_map(struct device *dev,
return -EINVAL; return -EINVAL;
} }
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
switch (val) { switch (val) {
...@@ -1001,7 +1001,7 @@ static ssize_t set_auto_pwm(struct device *dev, ...@@ -1001,7 +1001,7 @@ static ssize_t set_auto_pwm(struct device *dev,
int point = sensor_attr->index; int point = sensor_attr->index;
long val; long val;
if (strict_strtol(buf, 10, &val) < 0 || val < 0 || val > 255) if (kstrtol(buf, 10, &val) < 0 || val < 0 || val > 255)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1034,7 +1034,7 @@ static ssize_t set_auto_temp(struct device *dev, ...@@ -1034,7 +1034,7 @@ static ssize_t set_auto_temp(struct device *dev,
int point = sensor_attr->index; int point = sensor_attr->index;
long val; long val;
if (strict_strtol(buf, 10, &val) < 0 || val < -128000 || val > 127000) if (kstrtol(buf, 10, &val) < 0 || val < -128000 || val > 127000)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1126,7 +1126,7 @@ static ssize_t set_fan16_min(struct device *dev, struct device_attribute *attr, ...@@ -1126,7 +1126,7 @@ static ssize_t set_fan16_min(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1180,7 +1180,7 @@ static ssize_t clear_intrusion(struct device *dev, struct device_attribute ...@@ -1180,7 +1180,7 @@ static ssize_t clear_intrusion(struct device *dev, struct device_attribute
long val; long val;
int config; int config;
if (strict_strtol(buf, 10, &val) < 0 || val != 0) if (kstrtol(buf, 10, &val) < 0 || val != 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1231,7 +1231,7 @@ static ssize_t set_beep(struct device *dev, struct device_attribute *attr, ...@@ -1231,7 +1231,7 @@ static ssize_t set_beep(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0 if (kstrtol(buf, 10, &val) < 0
|| (val != 0 && val != 1)) || (val != 0 && val != 1))
return -EINVAL; return -EINVAL;
...@@ -1278,7 +1278,7 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr, ...@@ -1278,7 +1278,7 @@ static ssize_t store_vrm_reg(struct device *dev, struct device_attribute *attr,
struct it87_data *data = dev_get_drvdata(dev); struct it87_data *data = dev_get_drvdata(dev);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
data->vrm = val; data->vrm = val;
......
...@@ -309,7 +309,7 @@ static ssize_t set_##value(struct device *dev, \ ...@@ -309,7 +309,7 @@ static ssize_t set_##value(struct device *dev, \
struct jc42_data *data = i2c_get_clientdata(client); \ struct jc42_data *data = i2c_get_clientdata(client); \
int err, ret = count; \ int err, ret = count; \
long val; \ long val; \
if (strict_strtol(buf, 10, &val) < 0) \ if (kstrtol(buf, 10, &val) < 0) \
return -EINVAL; \ return -EINVAL; \
mutex_lock(&data->update_lock); \ mutex_lock(&data->update_lock); \
data->value = jc42_temp_to_reg(val, data->extended); \ data->value = jc42_temp_to_reg(val, data->extended); \
...@@ -337,7 +337,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev, ...@@ -337,7 +337,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev,
int err; int err;
int ret = count; int ret = count;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
diff = jc42_temp_from_reg(data->temp_crit) - val; diff = jc42_temp_from_reg(data->temp_crit) - val;
......
...@@ -50,7 +50,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da, ...@@ -50,7 +50,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
long temp; long temp;
short value; short value;
int status = strict_strtol(buf, 10, &temp); int status = kstrtol(buf, 10, &temp);
if (status < 0) if (status < 0)
return status; return status;
......
...@@ -730,7 +730,7 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr, ...@@ -730,7 +730,7 @@ static ssize_t set_temp8(struct device *dev, struct device_attribute *devattr,
long val; long val;
int err; int err;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -798,7 +798,7 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr, ...@@ -798,7 +798,7 @@ static ssize_t set_temp11(struct device *dev, struct device_attribute *devattr,
long val; long val;
int err; int err;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -859,7 +859,7 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy, ...@@ -859,7 +859,7 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy,
int err; int err;
int temp; int temp;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -912,7 +912,7 @@ static ssize_t set_update_interval(struct device *dev, ...@@ -912,7 +912,7 @@ static ssize_t set_update_interval(struct device *dev,
unsigned long val; unsigned long val;
int err; int err;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err) if (err)
return err; return err;
...@@ -1080,7 +1080,7 @@ static ssize_t set_pec(struct device *dev, struct device_attribute *dummy, ...@@ -1080,7 +1080,7 @@ static ssize_t set_pec(struct device *dev, struct device_attribute *dummy,
long val; long val;
int err; int err;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -169,7 +169,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr, ...@@ -169,7 +169,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
int shift; int shift;
u8 mask = to_sensor_dev_attr(attr)->index; u8 mask = to_sensor_dev_attr(attr)->index;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val != 1 && val != 2) if (val != 1 && val != 2)
return -EINVAL; return -EINVAL;
...@@ -216,7 +216,7 @@ static ssize_t set_min(struct device *dev, struct device_attribute *attr, ...@@ -216,7 +216,7 @@ static ssize_t set_min(struct device *dev, struct device_attribute *attr,
struct lm95241_data *data = i2c_get_clientdata(client); struct lm95241_data *data = i2c_get_clientdata(client);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val < -128000) if (val < -128000)
return -EINVAL; return -EINVAL;
...@@ -254,7 +254,7 @@ static ssize_t set_max(struct device *dev, struct device_attribute *attr, ...@@ -254,7 +254,7 @@ static ssize_t set_max(struct device *dev, struct device_attribute *attr,
struct lm95241_data *data = i2c_get_clientdata(client); struct lm95241_data *data = i2c_get_clientdata(client);
long val; long val;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val >= 256000) if (val >= 256000)
return -EINVAL; return -EINVAL;
...@@ -290,7 +290,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr, ...@@ -290,7 +290,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr,
struct lm95241_data *data = i2c_get_clientdata(client); struct lm95241_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
data->interval = val * HZ / 1000; data->interval = val * HZ / 1000;
......
...@@ -254,7 +254,7 @@ static ssize_t set_limit(struct device *dev, struct device_attribute *attr, ...@@ -254,7 +254,7 @@ static ssize_t set_limit(struct device *dev, struct device_attribute *attr,
int index = to_sensor_dev_attr(attr)->index; int index = to_sensor_dev_attr(attr)->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val /= 1000; val /= 1000;
...@@ -279,7 +279,7 @@ static ssize_t set_crit_hyst(struct device *dev, struct device_attribute *attr, ...@@ -279,7 +279,7 @@ static ssize_t set_crit_hyst(struct device *dev, struct device_attribute *attr,
struct lm95245_data *data = i2c_get_clientdata(client); struct lm95245_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val /= 1000; val /= 1000;
...@@ -316,7 +316,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr, ...@@ -316,7 +316,7 @@ static ssize_t set_type(struct device *dev, struct device_attribute *attr,
struct lm95245_data *data = i2c_get_clientdata(client); struct lm95245_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val != 1 && val != 2) if (val != 1 && val != 2)
return -EINVAL; return -EINVAL;
...@@ -363,7 +363,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr, ...@@ -363,7 +363,7 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr,
struct lm95245_data *data = i2c_get_clientdata(client); struct lm95245_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
......
...@@ -230,7 +230,7 @@ static ssize_t max16065_set_limit(struct device *dev, ...@@ -230,7 +230,7 @@ static ssize_t max16065_set_limit(struct device *dev,
int err; int err;
int limit; int limit;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (unlikely(err < 0)) if (unlikely(err < 0))
return err; return err;
......
...@@ -208,7 +208,7 @@ static ssize_t set_temp_max(struct device *dev, ...@@ -208,7 +208,7 @@ static ssize_t set_temp_max(struct device *dev,
unsigned long val; unsigned long val;
int res; int res;
res = strict_strtoul(buf, 10, &val); res = kstrtoul(buf, 10, &val);
if (res) if (res)
return res; return res;
...@@ -241,7 +241,7 @@ static ssize_t set_temp_crit(struct device *dev, ...@@ -241,7 +241,7 @@ static ssize_t set_temp_crit(struct device *dev,
unsigned long val; unsigned long val;
int res; int res;
res = strict_strtoul(buf, 10, &val); res = kstrtoul(buf, 10, &val);
if (res) if (res)
return res; return res;
...@@ -275,7 +275,7 @@ static ssize_t set_temp_emergency(struct device *dev, ...@@ -275,7 +275,7 @@ static ssize_t set_temp_emergency(struct device *dev,
unsigned long val; unsigned long val;
int res; int res;
res = strict_strtoul(buf, 10, &val); res = kstrtoul(buf, 10, &val);
if (res) if (res)
return res; return res;
...@@ -308,7 +308,7 @@ static ssize_t set_pwm(struct device *dev, ...@@ -308,7 +308,7 @@ static ssize_t set_pwm(struct device *dev,
unsigned long val; unsigned long val;
int res; int res;
res = strict_strtoul(buf, 10, &val); res = kstrtoul(buf, 10, &val);
if (res) if (res)
return res; return res;
......
...@@ -234,7 +234,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, ...@@ -234,7 +234,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
struct max6642_data *data = i2c_get_clientdata(client); struct max6642_data *data = i2c_get_clientdata(client);
struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(attr); struct sensor_device_attribute_2 *attr2 = to_sensor_dev_attr_2(attr);
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -418,7 +418,7 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute ...@@ -418,7 +418,7 @@ static ssize_t set_fan_min(struct device *dev, struct device_attribute
unsigned long val; unsigned long val;
int iobase = data->address[LD_FAN]; int iobase = data->address[LD_FAN];
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
...@@ -572,7 +572,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute ...@@ -572,7 +572,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute
int nr = to_sensor_dev_attr(devattr)->index; int nr = to_sensor_dev_attr(devattr)->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0 || val > 2) if (kstrtoul(buf, 10, &val) < 0 || val > 2)
return -EINVAL; return -EINVAL;
/* Can't go to automatic mode if it isn't configured */ /* Can't go to automatic mode if it isn't configured */
if (val == 2 && !(data->pwm_auto_ok & (1 << nr))) 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,7 +604,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute
int iobase = data->address[LD_FAN]; int iobase = data->address[LD_FAN];
u8 mode; u8 mode;
if (strict_strtoul(buf, 10, &val) < 0 || val > 0xff) if (kstrtoul(buf, 10, &val) < 0 || val > 0xff)
return -EINVAL; return -EINVAL;
mutex_lock(&data->lock); mutex_lock(&data->lock);
......
...@@ -683,7 +683,7 @@ static ssize_t sht15_store_heater(struct device *dev, ...@@ -683,7 +683,7 @@ static ssize_t sht15_store_heater(struct device *dev,
long value; long value;
u8 status; u8 status;
if (strict_strtol(buf, 10, &value)) if (kstrtol(buf, 10, &value))
return -EINVAL; return -EINVAL;
mutex_lock(&data->read_lock); mutex_lock(&data->read_lock);
......
...@@ -112,7 +112,7 @@ static ssize_t tmp102_set_temp(struct device *dev, ...@@ -112,7 +112,7 @@ static ssize_t tmp102_set_temp(struct device *dev,
long val; long val;
int status; int status;
if (strict_strtol(buf, 10, &val) < 0) if (kstrtol(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val = SENSORS_LIMIT(val, -256000, 255000); val = SENSORS_LIMIT(val, -256000, 255000);
......
...@@ -334,7 +334,7 @@ static ssize_t store_temp_min(struct device *dev, struct device_attribute ...@@ -334,7 +334,7 @@ static ssize_t store_temp_min(struct device *dev, struct device_attribute
long val; long val;
u16 reg; u16 reg;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
reg = tmp401_temp_to_register(val, data->config); 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,7 +361,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute
long val; long val;
u16 reg; u16 reg;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
reg = tmp401_temp_to_register(val, data->config); 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,7 +388,7 @@ static ssize_t store_temp_crit(struct device *dev, struct device_attribute
long val; long val;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
reg = tmp401_crit_temp_to_register(val, data->config); 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,7 +413,7 @@ static ssize_t store_temp_crit_hyst(struct device *dev, struct device_attribute
long val; long val;
u8 reg; u8 reg;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
if (data->config & TMP401_CONFIG_RANGE) if (data->config & TMP401_CONFIG_RANGE)
...@@ -447,7 +447,7 @@ static ssize_t reset_temp_history(struct device *dev, ...@@ -447,7 +447,7 @@ static ssize_t reset_temp_history(struct device *dev,
{ {
long val; long val;
if (strict_strtol(buf, 10, &val)) if (kstrtol(buf, 10, &val))
return -EINVAL; return -EINVAL;
if (val != 1) { if (val != 1) {
......
...@@ -937,7 +937,7 @@ store_in_##reg(struct device *dev, struct device_attribute *attr, \ ...@@ -937,7 +937,7 @@ store_in_##reg(struct device *dev, struct device_attribute *attr, \
int nr = sensor_attr->index; \ int nr = sensor_attr->index; \
unsigned long val; \ unsigned long val; \
int err; \ int err; \
err = strict_strtoul(buf, 10, &val); \ err = kstrtoul(buf, 10, &val); \
if (err < 0) \ if (err < 0) \
return err; \ return err; \
mutex_lock(&data->update_lock); \ mutex_lock(&data->update_lock); \
...@@ -1054,7 +1054,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr, ...@@ -1054,7 +1054,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
unsigned int reg; unsigned int reg;
u8 new_div; u8 new_div;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1199,7 +1199,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ ...@@ -1199,7 +1199,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
int nr = sensor_attr->index; \ int nr = sensor_attr->index; \
int err; \ int err; \
long val; \ long val; \
err = strict_strtol(buf, 10, &val); \ err = kstrtol(buf, 10, &val); \
if (err < 0) \ if (err < 0) \
return err; \ return err; \
mutex_lock(&data->update_lock); \ mutex_lock(&data->update_lock); \
...@@ -1324,7 +1324,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr, ...@@ -1324,7 +1324,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
int err; int err;
u16 reg; u16 reg;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1351,7 +1351,7 @@ store_pwm(struct device *dev, struct device_attribute *attr, ...@@ -1351,7 +1351,7 @@ store_pwm(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
int err; int err;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1376,7 +1376,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, ...@@ -1376,7 +1376,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
int err; int err;
u16 reg; u16 reg;
err = strict_strtoul(buf, 10, &val); err = kstrtoul(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1430,7 +1430,7 @@ store_target_temp(struct device *dev, struct device_attribute *attr, ...@@ -1430,7 +1430,7 @@ store_target_temp(struct device *dev, struct device_attribute *attr,
long val; long val;
int err; int err;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1455,7 +1455,7 @@ store_tolerance(struct device *dev, struct device_attribute *attr, ...@@ -1455,7 +1455,7 @@ store_tolerance(struct device *dev, struct device_attribute *attr,
long val; long val;
int err; int err;
err = strict_strtol(buf, 10, &val); err = kstrtol(buf, 10, &val);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1556,7 +1556,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ ...@@ -1556,7 +1556,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
int nr = sensor_attr->index; \ int nr = sensor_attr->index; \
unsigned long val; \ unsigned long val; \
int err; \ int err; \
err = strict_strtoul(buf, 10, &val); \ err = kstrtoul(buf, 10, &val); \
if (err < 0) \ if (err < 0) \
return err; \ return err; \
val = SENSORS_LIMIT(val, 1, 255); \ val = SENSORS_LIMIT(val, 1, 255); \
...@@ -1595,7 +1595,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \ ...@@ -1595,7 +1595,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
int nr = sensor_attr->index; \ int nr = sensor_attr->index; \
unsigned long val; \ unsigned long val; \
int err; \ int err; \
err = strict_strtoul(buf, 10, &val); \ err = kstrtoul(buf, 10, &val); \
if (err < 0) \ if (err < 0) \
return err; \ return err; \
val = step_time_to_reg(val, data->pwm_mode[nr]); \ val = step_time_to_reg(val, data->pwm_mode[nr]); \
...@@ -1702,7 +1702,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr, ...@@ -1702,7 +1702,7 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
u16 reg, mask; u16 reg, mask;
if (strict_strtoul(buf, 10, &val) || val != 0) if (kstrtoul(buf, 10, &val) || val != 0)
return -EINVAL; return -EINVAL;
mask = to_sensor_dev_attr_2(attr)->nr; mask = to_sensor_dev_attr_2(attr)->nr;
......
...@@ -711,7 +711,7 @@ static ssize_t store_pwm(struct device *dev, struct device_attribute *attr, ...@@ -711,7 +711,7 @@ static ssize_t store_pwm(struct device *dev, struct device_attribute *attr,
int nr = sensor_attr->index; int nr = sensor_attr->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -756,7 +756,7 @@ static ssize_t store_pwmenable(struct device *dev, ...@@ -756,7 +756,7 @@ static ssize_t store_pwmenable(struct device *dev,
u8 val_shift = 0; u8 val_shift = 0;
u8 keep_mask = 0; u8 keep_mask = 0;
int ret = strict_strtoul(buf, 10, &val); int ret = kstrtoul(buf, 10, &val);
if (ret || val < 1 || val > 3) if (ret || val < 1 || val > 3)
return -EINVAL; return -EINVAL;
...@@ -819,7 +819,7 @@ static ssize_t store_temp_target(struct device *dev, ...@@ -819,7 +819,7 @@ static ssize_t store_temp_target(struct device *dev,
unsigned long val; unsigned long val;
u8 target_mask; u8 target_mask;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -863,7 +863,7 @@ static ssize_t store_temp_tolerance(struct device *dev, ...@@ -863,7 +863,7 @@ static ssize_t store_temp_tolerance(struct device *dev,
u8 val_shift = 0; u8 val_shift = 0;
u8 keep_mask = 0; u8 keep_mask = 0;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
switch (nr) { switch (nr) {
......
...@@ -749,7 +749,7 @@ store_chassis_clear(struct device *dev, struct device_attribute *attr, ...@@ -749,7 +749,7 @@ store_chassis_clear(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
u8 reg; u8 reg;
if (strict_strtoul(buf, 10, &val) || val != 0) if (kstrtoul(buf, 10, &val) || val != 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
......
...@@ -450,7 +450,7 @@ store_chassis_clear(struct device *dev, ...@@ -450,7 +450,7 @@ store_chassis_clear(struct device *dev,
unsigned long val; unsigned long val;
u8 reg; u8 reg;
if (strict_strtoul(buf, 10, &val) || val != 0) if (kstrtoul(buf, 10, &val) || val != 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
......
...@@ -730,7 +730,7 @@ store_beep(struct device *dev, struct device_attribute *attr, ...@@ -730,7 +730,7 @@ store_beep(struct device *dev, struct device_attribute *attr,
u8 beep_bit = 1 << shift; u8 beep_bit = 1 << shift;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val != 0 && val != 1) if (val != 0 && val != 1)
return -EINVAL; return -EINVAL;
...@@ -755,7 +755,7 @@ store_chassis_clear(struct device *dev, ...@@ -755,7 +755,7 @@ store_chassis_clear(struct device *dev,
struct w83795_data *data = i2c_get_clientdata(client); struct w83795_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0 || val != 0) if (kstrtoul(buf, 10, &val) < 0 || val != 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -801,7 +801,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr, ...@@ -801,7 +801,7 @@ store_fan_min(struct device *dev, struct device_attribute *attr,
struct w83795_data *data = i2c_get_clientdata(client); struct w83795_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (kstrtoul(buf, 10, &val))
return -EINVAL; return -EINVAL;
val = fan_to_reg(val); val = fan_to_reg(val);
...@@ -863,7 +863,7 @@ store_pwm(struct device *dev, struct device_attribute *attr, ...@@ -863,7 +863,7 @@ store_pwm(struct device *dev, struct device_attribute *attr,
int index = sensor_attr->index; int index = sensor_attr->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -924,7 +924,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, ...@@ -924,7 +924,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
int i; int i;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if (val < 1 || val > 2) if (val < 1 || val > 2)
return -EINVAL; return -EINVAL;
...@@ -1021,7 +1021,7 @@ store_temp_src(struct device *dev, struct device_attribute *attr, ...@@ -1021,7 +1021,7 @@ store_temp_src(struct device *dev, struct device_attribute *attr,
unsigned long channel; unsigned long channel;
u8 val = index / 2; u8 val = index / 2;
if (strict_strtoul(buf, 10, &channel) < 0 || if (kstrtoul(buf, 10, &channel) < 0 ||
channel < 1 || channel > 14) channel < 1 || channel > 14)
return -EINVAL; return -EINVAL;
...@@ -1088,7 +1088,7 @@ store_temp_pwm_enable(struct device *dev, struct device_attribute *attr, ...@@ -1088,7 +1088,7 @@ store_temp_pwm_enable(struct device *dev, struct device_attribute *attr,
int index = sensor_attr->index; int index = sensor_attr->index;
unsigned long tmp; unsigned long tmp;
if (strict_strtoul(buf, 10, &tmp) < 0) if (kstrtoul(buf, 10, &tmp) < 0)
return -EINVAL; return -EINVAL;
switch (nr) { switch (nr) {
...@@ -1149,7 +1149,7 @@ store_fanin(struct device *dev, struct device_attribute *attr, ...@@ -1149,7 +1149,7 @@ store_fanin(struct device *dev, struct device_attribute *attr,
int index = sensor_attr->index; int index = sensor_attr->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1198,7 +1198,7 @@ store_temp_pwm(struct device *dev, struct device_attribute *attr, ...@@ -1198,7 +1198,7 @@ store_temp_pwm(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
u8 tmp; u8 tmp;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val /= 1000; val /= 1000;
...@@ -1257,7 +1257,7 @@ store_sf4_pwm(struct device *dev, struct device_attribute *attr, ...@@ -1257,7 +1257,7 @@ store_sf4_pwm(struct device *dev, struct device_attribute *attr,
int index = sensor_attr->index; int index = sensor_attr->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1293,7 +1293,7 @@ store_sf4_temp(struct device *dev, struct device_attribute *attr, ...@@ -1293,7 +1293,7 @@ store_sf4_temp(struct device *dev, struct device_attribute *attr,
int index = sensor_attr->index; int index = sensor_attr->index;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val /= 1000; val /= 1000;
...@@ -1333,7 +1333,7 @@ store_temp(struct device *dev, struct device_attribute *attr, ...@@ -1333,7 +1333,7 @@ store_temp(struct device *dev, struct device_attribute *attr,
struct w83795_data *data = i2c_get_clientdata(client); struct w83795_data *data = i2c_get_clientdata(client);
long tmp; long tmp;
if (strict_strtol(buf, 10, &tmp) < 0) if (kstrtol(buf, 10, &tmp) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1394,7 +1394,7 @@ store_dts_ext(struct device *dev, struct device_attribute *attr, ...@@ -1394,7 +1394,7 @@ store_dts_ext(struct device *dev, struct device_attribute *attr,
struct w83795_data *data = i2c_get_clientdata(client); struct w83795_data *data = i2c_get_clientdata(client);
long tmp; long tmp;
if (strict_strtol(buf, 10, &tmp) < 0) if (kstrtol(buf, 10, &tmp) < 0)
return -EINVAL; return -EINVAL;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
...@@ -1436,7 +1436,7 @@ store_temp_mode(struct device *dev, struct device_attribute *attr, ...@@ -1436,7 +1436,7 @@ store_temp_mode(struct device *dev, struct device_attribute *attr,
unsigned long val; unsigned long val;
u8 tmp; u8 tmp;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
if ((val != 4) && (val != 3)) if ((val != 4) && (val != 3))
return -EINVAL; return -EINVAL;
...@@ -1512,7 +1512,7 @@ store_in(struct device *dev, struct device_attribute *attr, ...@@ -1512,7 +1512,7 @@ store_in(struct device *dev, struct device_attribute *attr,
u8 tmp; u8 tmp;
u8 lsb_idx; u8 lsb_idx;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
val = in_to_reg(index, val); val = in_to_reg(index, val);
...@@ -1569,7 +1569,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, ...@@ -1569,7 +1569,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,
struct w83795_data *data = i2c_get_clientdata(client); struct w83795_data *data = i2c_get_clientdata(client);
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val) < 0) if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL; return -EINVAL;
switch (nr) { switch (nr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册