diff options
author | Eddie James <eajames@linux.ibm.com> | 2019-04-16 17:43:48 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2019-04-17 00:12:13 +0200 |
commit | b5c46a53ee6b1f97104883d93847b2b2fdddc289 (patch) | |
tree | fcfb20d259c7a37a785718d90892b9f61db7888d /drivers/hwmon/occ/common.h | |
parent | hwmon: (ina3221) Add averaging mode support (diff) | |
download | linux-b5c46a53ee6b1f97104883d93847b2b2fdddc289.tar.xz linux-b5c46a53ee6b1f97104883d93847b2b2fdddc289.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/hwmon/occ/common.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/occ/common.h b/drivers/hwmon/occ/common.h index ed2cf4245295..fc13f3c73c47 100644 --- a/drivers/hwmon/occ/common.h +++ b/drivers/hwmon/occ/common.h @@ -106,7 +106,8 @@ struct occ { struct attribute_group group; const struct attribute_group *groups[2]; - int error; /* latest transfer error */ + int error; /* final transfer error after retry */ + int last_error; /* latest transfer error */ unsigned int error_count; /* number of xfr errors observed */ unsigned long last_safe; /* time OCC entered "safe" state */ |