hwmon: (occ) Print response status in first poll error message
authorEddie James <eajames@linux.ibm.com>
Tue, 9 Feb 2021 17:12:35 +0000 (11:12 -0600)
committerJoel Stanley <joel@jms.id.au>
Fri, 4 Jun 2021 04:59:58 +0000 (14:29 +0930)
In order to better debug problems starting up the driver, print
the response status from the OCC in the error logged when the first
poll command fails.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210209171235.20624-5-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/hwmon/occ/common.c

index 7e73418ee0ad800ed76fee190ec38ebd347697c3..6b7bf46b21cba212c49f9c66fccc16acfb506d7e 100644 (file)
@@ -1162,8 +1162,9 @@ int occ_setup(struct occ *occ, const char *name)
                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);
+               dev_err(occ->bus_dev,
+                       "failed to get OCC poll response=%02x: %d\n",
+                       occ->resp.return_status, rc);
                return rc;
        }