Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364310 > unrolled thread

[PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range()

Started byBartosz Golaszewski <bgolaszewski@baylibre.com>
First post2016-03-24 17:30 +0100
Last post2016-03-24 17:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range() Bartosz Golaszewski <bgolaszewski@baylibre.com> - 2016-03-24 17:30 +0100

#1364310 — [PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range()

FromBartosz Golaszewski <bgolaszewski@baylibre.com>
Date2016-03-24 17:30 +0100
Subject[PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range()
Message-ID<rggj0-5dz-3@gated-at.bofh.it>
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@baylibre.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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web