diff mbox

spi: core: Replace msleep with usleep_range to get more accurate sleep time

Message ID 1392945318.4125.5.camel@phoenix (mailing list archive)
State Accepted
Commit f97b26b05b1dcd307b2f79d1f9e9d99551987dbb
Headers show

Commit Message

Axel Lin Feb. 21, 2014, 1:15 a.m. UTC
Fixes below checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(10);

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Feb. 23, 2014, 4:40 a.m. UTC | #1
On Fri, Feb 21, 2014 at 09:15:18AM +0800, Axel Lin wrote:
> Fixes below checkpatch warning:
> WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
> +               msleep(10);

Applied, thanks, though really we don't care how long the delay is.
diff mbox

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 2b664c8..055580f 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1078,7 +1078,7 @@  static int spi_stop_queue(struct spi_master *master)
 	 */
 	while ((!list_empty(&master->queue) || master->busy) && limit--) {
 		spin_unlock_irqrestore(&master->queue_lock, flags);
-		msleep(10);
+		usleep_range(10000, 11000);
 		spin_lock_irqsave(&master->queue_lock, flags);
 	}