All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Antipov <dmitry.antipov@linaro.org>
To: linaro-dev@lists.linaro.org
Cc: patches@linaro.org, linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: use usleep_range() instead of mdelay()/udelay()
Date: Wed, 21 Dec 2011 11:04:53 +0400	[thread overview]
Message-ID: <4EF18515.9030800@linaro.org> (raw)

 From 00753f3d48c4b6c45c1778c3e37bc9949ed79e77 Mon Sep 17 00:00:00 2001
From: Dmitry Antipov <dmitry.antipov@linaro.org>
Date: Wed, 21 Dec 2011 11:01:42 +0400
Subject: [PATCH] regulator: use usleep_range() instead of mdelay()/udelay()

---
  drivers/regulator/core.c |    7 +------
  1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 938398f..183ded8 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1379,12 +1379,7 @@ static int _regulator_enable(struct regulator_dev *rdev)

  			trace_regulator_enable_delay(rdev_get_name(rdev));

-			if (delay >= 1000) {
-				mdelay(delay / 1000);
-				udelay(delay % 1000);
-			} else if (delay) {
-				udelay(delay);
-			}
+			usleep_range(delay, delay + 1000);

  			trace_regulator_enable_complete(rdev_get_name(rdev));

-- 
1.7.7.4


             reply	other threads:[~2011-12-21  7:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  7:04 Dmitry Antipov [this message]
2011-12-23 15:31 ` [PATCH] regulator: use usleep_range() instead of mdelay()/udelay() Mark Brown

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=4EF18515.9030800@linaro.org \
    --to=dmitry.antipov@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.