From: "Pali Rohár" <pali.rohar@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: "Steven Honeyman" <stevenhoneyman@gmail.com>,
linux-kernel@vger.kernel.org,
"Gabriele Mazzotta" <gabriele.mzt@gmail.com>,
"Pali Rohár" <pali.rohar@gmail.com>
Subject: [PATCH 3/3] i8k: Return -ENODATA for invalid temperature
Date: Sun, 30 Nov 2014 21:26:18 +0100 [thread overview]
Message-ID: <1417379178-5236-3-git-send-email-pali.rohar@gmail.com> (raw)
In-Reply-To: <1417379178-5236-1-git-send-email-pali.rohar@gmail.com>
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>
---
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
next prev parent reply other threads:[~2014-11-30 20:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-30 20:26 [PATCH 1/3] i8k: Add support for temperature sensor labels Pali Rohár
2014-11-30 20:26 ` [PATCH 2/3] i8k: Register only temperature sensors which have labels Pali Rohár
2014-11-30 20:49 ` Guenter Roeck
2014-11-30 20:26 ` Pali Rohár [this message]
2014-11-30 20:50 ` [PATCH 3/3] i8k: Return -ENODATA for invalid temperature Guenter Roeck
2014-11-30 20:48 ` [PATCH 1/3] i8k: Add support for temperature sensor labels Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417379178-5236-3-git-send-email-pali.rohar@gmail.com \
--to=pali.rohar@gmail.com \
--cc=arnd@arndb.de \
--cc=gabriele.mzt@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=stevenhoneyman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome