[PATCH linux dev-4.13 2/3] hwmon: occ: Avoid displaying an error when host is down

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue May 29 14:28:32 AEST 2018


Instead display a much less scary informational message as
this can happen in normal circumstances.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 drivers/hwmon/occ/common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
index 365bf207cf0d..0673af00a99b 100644
--- a/drivers/hwmon/occ/common.c
+++ b/drivers/hwmon/occ/common.c
@@ -1359,7 +1359,10 @@ int occ_setup(struct occ *occ, const char *name)
 
 	/* no need to lock */
 	rc = occ_poll(occ);
-	if (rc < 0) {
+	if (rc == -ESHUTDOWN) {
+		dev_info(occ->bus_dev, "Host is not ready\n");
+		return rc;
+	} else if (rc < 0) {
 		dev_err(occ->bus_dev, "failed to get OCC poll response: %d\n",
 			rc);
 		return rc;
-- 
2.17.0



More information about the openbmc mailing list