Commit 65815c0b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: remove ehci and ohci's private sleep function and use msleep() instead.

parent ad72bf4f
......@@ -632,7 +632,7 @@ static int ehci_suspend (struct usb_hcd *hcd, u32 state)
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
while (time_before (jiffies, ehci->next_statechange))
msec_delay (100);
msleep (100);
#ifdef CONFIG_USB_SUSPEND
(void) usb_suspend_device (hcd->self.root_hub);
......@@ -654,7 +654,7 @@ static int ehci_resume (struct usb_hcd *hcd)
// maybe restore (PCI) FLADJ
while (time_before (jiffies, ehci->next_statechange))
msec_delay (100);
msleep (100);
#ifdef CONFIG_USB_SUSPEND
retval = usb_resume_device (hcd->self.root_hub);
......
......@@ -596,12 +596,6 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
/*-------------------------------------------------------------------------*/
static inline void msec_delay(unsigned msec)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(msecs_to_jiffies(msec));
}
#ifndef DEBUG
#define STUB_DEBUG_FILES
#endif /* DEBUG */
......
......@@ -417,7 +417,7 @@ static int hc_reset (struct ohci_hcd *ohci)
writel (OHCI_INTR_OC, &ohci->regs->intrenable);
writel (OHCI_OCR, &ohci->regs->cmdstatus);
while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
msec_delay (10);
msleep (10);
if (--temp == 0) {
ohci_err (ohci, "USB HC TakeOver failed!\n");
return -1;
......@@ -451,7 +451,7 @@ static int hc_reset (struct ohci_hcd *ohci)
}
// flush those pci writes
(void) readl (&ohci->regs->control);
msec_delay (50);
msleep (50);
/* HC Reset requires max 10 us delay */
writel (OHCI_HCR, &ohci->regs->cmdstatus);
......
......@@ -248,7 +248,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
/* Then re-enable operations */
writel (OHCI_USB_OPER, &ohci->regs->control);
(void) readl (&ohci->regs->control);
msec_delay (3);
msleep (3);
temp = OHCI_CONTROL_INIT | OHCI_USB_OPER;
if (ohci->hcd.can_wakeup)
......@@ -258,7 +258,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
(void) readl (&ohci->regs->control);
/* TRSMRCY */
msec_delay (10);
msleep (10);
root->dev.power.power_state = 0;
/* keep it alive for ~5x suspend + resume costs */
......
......@@ -122,7 +122,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
/* suspend root hub, hoping it keeps power during suspend */
while (time_before (jiffies, ohci->next_statechange))
msec_delay (100);
msleep (100);
#ifdef CONFIG_USB_SUSPEND
(void) usb_suspend_device (hcd->self.root_hub);
......@@ -133,7 +133,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
#endif
/* let things settle down a bit */
msec_delay (100);
msleep (100);
#ifdef CONFIG_PMAC_PBOOK
if (_machine == _MACH_Pmac)
......@@ -170,7 +170,7 @@ static int ohci_pci_resume (struct usb_hcd *hcd)
/* resume root hub */
while (time_before (jiffies, ohci->next_statechange))
msec_delay (100);
msleep (100);
#ifdef CONFIG_USB_SUSPEND
/* get extra cleanup even if remote wakeup isn't in use */
retval = usb_resume_device (hcd->self.root_hub);
......
......@@ -397,12 +397,6 @@ static inline void disable (struct ohci_hcd *ohci)
ohci->hcd.state = USB_STATE_HALT;
}
static inline void msec_delay(unsigned msec)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(msecs_to_jiffies(msec));
}
#define FI 0x2edf /* 12000 bits per frame (-1) */
#define DEFAULT_FMINTERVAL ((((6 * (FI - 210)) / 7) << 16) | FI)
#define LSTHRESH 0x628 /* lowspeed bit threshold */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment