diff options
author | Eddie James <eajames@linux.ibm.com> | 2021-04-29 18:13:36 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2021-05-10 16:27:33 +0300 |
commit | 5216dff22dc2bbbbe6f00335f9fd2879670e753b (patch) | |
tree | 63c697a13879a0afdba14e6adb937bd90aef82bd /drivers/hwmon/occ/common.h | |
parent | 726c945ab2ebd104631b6105ab455a5bc604a3f1 (diff) | |
download | linux-5216dff22dc2bbbbe6f00335f9fd2879670e753b.tar.xz |
hwmon: (occ) Fix poll rate limiting
The poll rate limiter time was initialized at zero. This breaks the
comparison in time_after if jiffies is large. Switch to storing the
next update time rather than the previous time, and initialize the
time when the device is probed.
Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20210429151336.18980-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/occ/common.h')
-rw-r--r-- | drivers/hwmon/occ/common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/occ/common.h b/drivers/hwmon/occ/common.h index 67e6968b8978..e6df719770e8 100644 --- a/drivers/hwmon/occ/common.h +++ b/drivers/hwmon/occ/common.h @@ -99,7 +99,7 @@ struct occ { u8 poll_cmd_data; /* to perform OCC poll command */ int (*send_cmd)(struct occ *occ, u8 *cmd); - unsigned long last_update; + unsigned long next_update; struct mutex lock; /* lock OCC access */ struct device *hwmon; |