mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Frederich <jfrederich@gmail.com>
To: gregkh@linuxfoundation.org
Cc: jon.nettleton@gmail.com, cjb@laptop.org, dilinger@queued.net,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Jens Frederich <jfrederich@gmail.com>
Subject: [PATCH] Staging: olpc_dcon: change to msleep to usleep_range
Date: Thu, 25 Jul 2013 22:06:32 +0200	[thread overview]
Message-ID: <1374782792-2088-1-git-send-email-jfrederich@gmail.com> (raw)

The resolution of msleep is related to HZ, so with HZ set to
100 any msleep of less then 10ms will become ~10ms. This is
not what we want. Use usleep_range to get more control of
what is happening here.

Signed-off-by: Jens Frederich <jfrederich@gmail.com>
---
 drivers/staging/olpc_dcon/olpc_dcon.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 193e1c6..7c460f2 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -131,13 +131,13 @@ power_up:
 			pr_warn("unable to force dcon to power up: %d!\n", x);
 			return x;
 		}
-		msleep(10); /* we'll be conservative */
+		usleep_range(10000, 11000);  /* we'll be conservative */
 	}
 
 	pdata->bus_stabilize_wiggle();
 
 	for (x = -1, timeout = 50; timeout && x < 0; timeout--) {
-		msleep(1);
+		usleep_range(1000, 1100);
 		x = dcon_read(dcon, DCON_REG_ID);
 	}
 	if (x < 0) {
-- 
1.7.9.5


                 reply	other threads:[~2013-07-25 20:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374782792-2088-1-git-send-email-jfrederich@gmail.com \
    --to=jfrederich@gmail.com \
    --cc=cjb@laptop.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=dilinger@queued.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jon.nettleton@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®