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-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()
Date: Wed, 21 Dec 2011 11:07:22 +0400	[thread overview]
Message-ID: <4EF185AA.2000006@linaro.org> (raw)

 From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
From: Dmitry Antipov <dmitry.antipov@linaro.org>
Date: Wed, 21 Dec 2011 11:05:27 +0400
Subject: [PATCH] ohci-hcd: use usleep_range() instead of mdelay()

---
  drivers/usb/host/ohci-hcd.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index b263919..a6d58da 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -574,6 +574,7 @@ static int ohci_run (struct ohci_hcd *ohci)
  	u32			mask, val;
  	int			first = ohci->fminterval == 0;
  	struct usb_hcd		*hcd = ohci_to_hcd(ohci);
+	unsigned long		usecs;

  	disable (ohci);

@@ -724,7 +725,8 @@ retry:
  	spin_unlock_irq (&ohci->lock);

  	// POTPGT delay is bits 24-31, in 2 ms units.
-	mdelay ((val >> 23) & 0x1fe);
+	usecs = ((val >> 23) & 0x1fe) * USEC_PER_MSEC;
+	usleep_range(usecs, usecs + 1000);
  	hcd->state = HC_STATE_RUNNING;

  	if (quirk_zfmicro(ohci)) {
-- 
1.7.7.4


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  7:07 Dmitry Antipov [this message]
2011-12-21 21:12 ` [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay() Greg KH
2011-12-22  3:05 ` Alan Stern

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=4EF185AA.2000006@linaro.org \
    --to=dmitry.antipov@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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.