diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2015-01-12 14:31:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-25 09:17:58 -0800 |
commit | 83d514d76278e85cc74c472dd51687c8eb4faff0 (patch) | |
tree | 8aebe520d7fce23f0d98caa484e72f93479dda92 /drivers/char | |
parent | 672af223305791c3a814ec8c4fb841dc75277f48 (diff) | |
download | linux-83d514d76278e85cc74c472dd51687c8eb4faff0.tar.bz2 |
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) prev[sensor] = temp; } if (temp > I8K_MAX_TEMP) - return -ERANGE; + return -ENODATA; #endif return temp; @@ -533,8 +533,6 @@ static ssize_t i8k_hwmon_show_temp(struct device *dev, int temp; temp = i8k_get_temp(index); - if (temp == -ERANGE) - return -EINVAL; if (temp < 0) return temp; return sprintf(buf, "%d\n", temp * 1000); |