hwmon: (occ) Store error condition for rate-limited polls
authorEddie James <eajames@linux.ibm.com>
Tue, 16 Apr 2019 15:43:48 +0000 (15:43 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 16 Apr 2019 22:12:13 +0000 (15:12 -0700)
commitb5c46a53ee6b1f97104883d93847b2b2fdddc289
treefcfb20d259c7a37a785718d90892b9f61db7888d
parent5c090abf945bf5fd496c861f371410888be8f4de
hwmon: (occ) Store error condition for rate-limited polls

The OCC driver limits the rate of sending poll commands to the OCC. If a
user reads a hwmon entry after a poll response resulted in an error and
is rate-limited, the error is invisible to the user. Fix this by storing
the last error and returning that in the rate-limited case.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/occ/common.c
drivers/hwmon/occ/common.h