[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417379178-5236-3-git-send-email-pali.rohar@gmail.com>
Date: Sun, 30 Nov 2014 21:26:18 +0100
From: Pali Rohár <pali.rohar@...il.com>
To: Guenter Roeck <linux@...ck-us.net>, Arnd Bergmann <arnd@...db.de>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>
Cc: Steven Honeyman <stevenhoneyman@...il.com>,
linux-kernel@...r.kernel.org,
Gabriele Mazzotta <gabriele.mzt@...il.com>,
Pali Rohár <pali.rohar@...il.com>
Subject: [PATCH 3/3] 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@...il.com>
---
drivers/char/i8k.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 7b56ede..8c7c642 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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists