diff options
author | Armin Wolf <W_Armin@gmx.de> | 2022-02-01 00:19:34 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-02-28 04:03:17 +0300 |
commit | 799c3e1e5348effda4312764bb484a084d561949 (patch) | |
tree | 66f27206f67e4cfe7c7ac86c2bfbb2b58b94f006 /drivers/hwmon/sch56xx-common.c | |
parent | 393935baa45e5ccb9603cf7f9f020ed1bc0915f7 (diff) | |
download | linux-799c3e1e5348effda4312764bb484a084d561949.tar.xz |
hwmon: (sch56xx-common) Replace msleep() with usleep_range()
msleep(1) will often sleep more than 20ms, slowing down sensor
and watchdog reads/writes. Use usleep_range() as recommended
in timers-howto.rst to fix that.
Tested on a Fujitsu Esprimo P720.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20220131211935.3656-4-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/sch56xx-common.c')
-rw-r--r-- | drivers/hwmon/sch56xx-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index 0172aa16dc0c..82602b74c7ed 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -139,7 +139,7 @@ static int sch56xx_send_cmd(u16 addr, u8 cmd, u16 reg, u8 v) /* EM Interface Polling "Algorithm" */ for (i = 0; i < max_busy_polls + max_lazy_polls; i++) { if (i >= max_busy_polls) - msleep(1); + usleep_range(1000, 2000); /* Read Interrupt source Register */ val = inb(addr + 8); /* Write Clear the interrupt source bits */ |