[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458836383-6668-6-git-send-email-bgolaszewski@baylibre.com>
Date: Thu, 24 Mar 2016 17:19:35 +0100
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Wolfram Sang <wsa@...-dreams.de>,
linux-i2c <linux-i2c@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Cc: Andrew Lunn <andrew@...n.ch>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range()
We cannot expect msleep(1) to actually sleep for a period shorter than
20 ms. Replace all calls to msleep() with usleep_range().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
drivers/misc/eeprom/at24.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 9e01428..bc5be1e 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -240,8 +240,7 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf,
if (status == count)
return count;
- /* REVISIT: at HZ=100, this is sloooow */
- msleep(1);
+ usleep_range(1000, 1500);
} while (time_before(read_time, timeout));
return -ETIMEDOUT;
@@ -355,8 +354,7 @@ static ssize_t at24_eeprom_write(struct at24_data *at24, const char *buf,
if (status == count)
return count;
- /* REVISIT: at HZ=100, this is sloooow */
- msleep(1);
+ usleep_range(1000, 1500);
} while (time_before(write_time, timeout));
return -ETIMEDOUT;
--
2.7.4
Powered by blists - more mailing lists