diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2015-01-12 08:31:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-25 12:17:58 -0500 |
commit | 83d514d76278e85cc74c472dd51687c8eb4faff0 (patch) | |
tree | 8aebe520d7fce23f0d98caa484e72f93479dda92 /drivers/char | |
parent | 672af223305791c3a814ec8c4fb841dc75277f48 (diff) |
i8k: Return -ENODATA for invalid temperature
Guenter Roeck suggested to return -ENODATA instead -ERANGE or -EINVAL when BIOS
reports invalid temperature value.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/i8k.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index afcc9fe084dc..1854faba8ae6 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -331,7 +331,7 @@ static int i8k_get_temp(int sensor) | |||
331 | prev[sensor] = temp; | 331 | prev[sensor] = temp; |
332 | } | 332 | } |
333 | if (temp > I8K_MAX_TEMP) | 333 | if (temp > I8K_MAX_TEMP) |
334 | return -ERANGE; | 334 | return -ENODATA; |
335 | #endif | 335 | #endif |
336 | 336 | ||
337 | return temp; | 337 | return temp; |
@@ -533,8 +533,6 @@ static ssize_t i8k_hwmon_show_temp(struct device *dev, | |||
533 | int temp; | 533 | int temp; |
534 | 534 | ||
535 | temp = i8k_get_temp(index); | 535 | temp = i8k_get_temp(index); |
536 | if (temp == -ERANGE) | ||
537 | return -EINVAL; | ||
538 | if (temp < 0) | 536 | if (temp < 0) |
539 | return temp; | 537 | return temp; |
540 | return sprintf(buf, "%d\n", temp * 1000); | 538 | return sprintf(buf, "%d\n", temp * 1000); |