diff options
| -rw-r--r-- | drivers/hwmon/emc2103.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c index b07305622087..2c137b26acb4 100644 --- a/drivers/hwmon/emc2103.c +++ b/drivers/hwmon/emc2103.c | |||
| @@ -248,7 +248,7 @@ static ssize_t set_temp_min(struct device *dev, struct device_attribute *da, | |||
| 248 | 248 | ||
| 249 | int result = kstrtol(buf, 10, &val); | 249 | int result = kstrtol(buf, 10, &val); |
| 250 | if (result < 0) | 250 | if (result < 0) |
| 251 | return -EINVAL; | 251 | return result; |
| 252 | 252 | ||
| 253 | val = DIV_ROUND_CLOSEST(val, 1000); | 253 | val = DIV_ROUND_CLOSEST(val, 1000); |
| 254 | if ((val < -63) || (val > 127)) | 254 | if ((val < -63) || (val > 127)) |
| @@ -272,7 +272,7 @@ static ssize_t set_temp_max(struct device *dev, struct device_attribute *da, | |||
| 272 | 272 | ||
| 273 | int result = kstrtol(buf, 10, &val); | 273 | int result = kstrtol(buf, 10, &val); |
| 274 | if (result < 0) | 274 | if (result < 0) |
| 275 | return -EINVAL; | 275 | return result; |
| 276 | 276 | ||
| 277 | val = DIV_ROUND_CLOSEST(val, 1000); | 277 | val = DIV_ROUND_CLOSEST(val, 1000); |
| 278 | if ((val < -63) || (val > 127)) | 278 | if ((val < -63) || (val > 127)) |
| @@ -320,7 +320,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *da, | |||
| 320 | 320 | ||
| 321 | int status = kstrtol(buf, 10, &new_div); | 321 | int status = kstrtol(buf, 10, &new_div); |
| 322 | if (status < 0) | 322 | if (status < 0) |
| 323 | return -EINVAL; | 323 | return status; |
| 324 | 324 | ||
| 325 | if (new_div == old_div) /* No change */ | 325 | if (new_div == old_div) /* No change */ |
| 326 | return count; | 326 | return count; |
| @@ -394,7 +394,7 @@ static ssize_t set_fan_target(struct device *dev, struct device_attribute *da, | |||
| 394 | 394 | ||
| 395 | int result = kstrtol(buf, 10, &rpm_target); | 395 | int result = kstrtol(buf, 10, &rpm_target); |
| 396 | if (result < 0) | 396 | if (result < 0) |
| 397 | return -EINVAL; | 397 | return result; |
| 398 | 398 | ||
| 399 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ | 399 | /* Datasheet states 16384 as maximum RPM target (table 3.2) */ |
| 400 | if ((rpm_target < 0) || (rpm_target > 16384)) | 400 | if ((rpm_target < 0) || (rpm_target > 16384)) |
| @@ -440,7 +440,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da, | |||
| 440 | 440 | ||
| 441 | int result = kstrtol(buf, 10, &new_value); | 441 | int result = kstrtol(buf, 10, &new_value); |
| 442 | if (result < 0) | 442 | if (result < 0) |
| 443 | return -EINVAL; | 443 | return result; |
| 444 | 444 | ||
| 445 | mutex_lock(&data->update_lock); | 445 | mutex_lock(&data->update_lock); |
| 446 | switch (new_value) { | 446 | switch (new_value) { |
