Commit 83d514d7 authored by Pali Rohár's avatar Pali Rohár Committed by Greg Kroah-Hartman

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: default avatarPali Rohár <pali.rohar@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 672af223
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment