]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: replace wait_ms() with mdelay()
authorMike Frysinger <vapier@gentoo.org>
Mon, 5 Mar 2012 13:47:00 +0000 (13:47 +0000)
committerMarek Vasut <marek.vasut@gmail.com>
Sun, 18 Mar 2012 23:08:16 +0000 (00:08 +0100)
Common code has a mdelay() func, so use that instead of the usb-specific
wait_ms() func.  This also fixes the build errors:

ohci-hcd.c: In function 'submit_common_msg':
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1519:9: sorry, unimplemented: called from here
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1816:10: sorry, unimplemented: called from here
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1827:10: sorry, unimplemented: called from here
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1844:10: sorry, unimplemented: called from here
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1563:11: sorry, unimplemented: called from here
/usr/local/src/u-boot/blackfin/include/usb.h:202:44: sorry, unimplemented: inlining failed in call to 'wait_ms': function body not available
ohci-hcd.c:1583:9: sorry, unimplemented: called from here
make[1]: *** [ohci-hcd.o] Error 1

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Marek Vasut <marex@denx.de>
18 files changed:
arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c
arch/arm/cpu/pxa/usb.c
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
arch/powerpc/cpu/mpc5xxx/usb_ohci.c
arch/powerpc/cpu/ppc4xx/usb_ohci.c
arch/sparc/cpu/leon3/usb_uhci.c
board/efikamx/efikamx-usb.c
board/mcc200/auto_update.c
board/mpl/common/usb_uhci.c
board/renesas/sh7785lcr/selfcheck.c
common/usb.c
common/usb_hub.c
common/usb_storage.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/r8a66597-hcd.c
include/usb.h

index 80bb61b27ee08f4193ac97d789aafb614d7d5096..cf0335c7320feac75f55b5d92364444fb75f4bb3 100644 (file)
@@ -1057,7 +1057,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
        pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)",
                  usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (usb_pipeint(pipe)) {
                info("Root-Hub submit IRQ: NOT implemented");
@@ -1260,7 +1260,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 #ifdef DEBUG
        ohci_dump_roothub(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
@@ -1275,7 +1275,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
        pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)",
                  0 /*usb_pipein(pipe) */);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        return stat;
@@ -1302,7 +1302,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB",
                  usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_common_message: pipesize for pipe %lx is zero",
@@ -1316,7 +1316,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                return -1;
        }
 
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 
        /* allow more time for a BULK device to react - some are slow */
@@ -1351,7 +1351,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
@@ -1396,7 +1396,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)",
                  usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        /* free TDs in urb_priv */
@@ -1423,7 +1423,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB",
                  usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_control_message: pipesize for pipe %lx is zero",
@@ -1463,7 +1463,7 @@ static int hc_reset(struct ohci *ohci)
                writel(OHCI_OCR, &ohci->regs->cmdstatus);
                info("USB HC TakeOver from SMM");
                while (readl(&ohci->regs->control) & OHCI_CTRL_IR) {
-                       wait_ms(10);
+                       mdelay(10);
                        if (--smm_timeout == 0) {
                                err("USB HC TakeOver failed!");
                                return -1;
@@ -1600,7 +1600,7 @@ static int hc_interrupt(void)
 #ifdef DEBUG
                ohci_dump(ohci, 1);
 #else
-               wait_ms(1);
+               mdelay(1);
 #endif
                /* FIXME: be optimistic, hope that bug won't repeat often. */
                /* Make some non-interrupt context restart the controller. */
@@ -1611,7 +1611,7 @@ static int hc_interrupt(void)
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
 
                writel(OHCI_INTR_WDH, &regs->intrdisable);
                stat = dl_done_list(&gohci, dl_reverse_done_list(&gohci));
@@ -1627,7 +1627,7 @@ static int hc_interrupt(void)
        /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
        if (ints & OHCI_INTR_SF) {
                unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1;
-               wait_ms(1);
+               mdelay(1);
                writel(OHCI_INTR_SF, &regs->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel(OHCI_INTR_SF, &regs->intrenable);
@@ -1718,7 +1718,7 @@ int usb_lowlevel_init(void)
        /* FIXME this is a second HC reset; why?? */
        gohci.hc_control = OHCI_USB_RESET;
        writel(gohci.hc_control, &gohci.regs->control);
-       wait_ms(10);
+       mdelay(10);
 
        if (hc_start(&gohci) < 0) {
                err("can't start usb-%s", gohci.slot_name);
@@ -1730,7 +1730,7 @@ int usb_lowlevel_init(void)
 #ifdef DEBUG
        ohci_dump(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        urb_finished = 1;
index 307fc6ceec3b819016a5f2e648a81bc2fece0b7b..6c7e496db78bed4d9785dfd9c95d084a9971fc01 100644 (file)
@@ -48,7 +48,7 @@ int usb_cpu_init(void)
 #endif
 
        writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
-       wait_ms(11);
+       mdelay(11);
        writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
 
        writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
index 866dd6cfe4af6ab6838c1093b28af8545b27a5a4..7647e118414f111bc27719283336fccb617eb52c 100644 (file)
@@ -1012,7 +1012,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 urb_priv.actual_length = 0;
 pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (usb_pipeint(pipe)) {
                info("Root-Hub submit IRQ: NOT implemented");
@@ -1189,7 +1189,7 @@ pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
 #ifdef DEBUG
        ohci_dump_roothub (&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
@@ -1203,7 +1203,7 @@ pkt_print(dev, pipe, buffer, transfer_len, cmd, "SUB(rh)", usb_pipein(pipe));
                urb_priv.actual_length = transfer_len;
        pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        return stat;
@@ -1230,7 +1230,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        urb_priv.actual_length = 0;
        pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_common_message: pipesize for pipe %lx is zero",
@@ -1243,7 +1243,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                return -1;
        }
 
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 
        /* allow more time for a BULK device to react - some are slow */
@@ -1267,7 +1267,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        break;
                }
                if (--timeout) {
-                       udelay(250); /* wait_ms(1); */
+                       udelay(250); /* mdelay(1); */
                } else {
                        err("CTL:TIMEOUT ");
                        stat = USB_ST_CRC_ERR;
@@ -1302,7 +1302,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 #ifdef DEBUG
        pkt_print(dev, pipe, buffer, transfer_len, setup, "RET(ctlr)", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        /* free TDs in urb_priv */
@@ -1328,7 +1328,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        urb_priv.actual_length = 0;
        pkt_print(dev, pipe, buffer, transfer_len, setup, "SUB", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_control_message: pipesize for pipe %lx is zero",
@@ -1367,7 +1367,7 @@ static int hc_reset (ohci_t *ohci)
                writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
                info("USB HC TakeOver from SMM");
                while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
-                       wait_ms (10);
+                       mdelay (10);
                        if (--smm_timeout == 0) {
                                err("USB HC TakeOver failed!");
                                return -1;
@@ -1490,7 +1490,7 @@ hc_interrupt (void)
 #ifdef DEBUG
                ohci_dump (ohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
                /* FIXME: be optimistic, hope that bug won't repeat often. */
                /* Make some non-interrupt context restart the controller. */
@@ -1501,7 +1501,7 @@ hc_interrupt (void)
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
                writel (OHCI_INTR_WDH, &regs->intrdisable);
                stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
                writel (OHCI_INTR_WDH, &regs->intrenable);
@@ -1516,7 +1516,7 @@ hc_interrupt (void)
        /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
        if (ints & OHCI_INTR_SF) {
                unsigned int frame = m16_swap (ohci->hcca->frame_no) & 1;
-               wait_ms(1);
+               mdelay(1);
                writel (OHCI_INTR_SF, &regs->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, &regs->intrenable);
@@ -1686,7 +1686,7 @@ int usb_lowlevel_init(void)
 
        /* FIXME this is a second HC reset; why?? */
        writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
-       wait_ms (10);
+       mdelay (10);
 
        if (hc_start (&gohci) < 0)
                goto errout;
@@ -1694,7 +1694,7 @@ int usb_lowlevel_init(void)
 #ifdef DEBUG
        ohci_dump (&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        return 0;
index d250c199f83ef97137d200961626ee7f6df1e595..6d915256a31f50118ddaf916550fdd362b09c7bb 100644 (file)
@@ -1269,7 +1269,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
@@ -1372,7 +1372,7 @@ static int hc_reset (ohci_t *ohci)
                writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
                info("USB HC TakeOver from SMM");
                while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
-                       wait_ms (10);
+                       mdelay (10);
                        if (--smm_timeout == 0) {
                                err("USB HC TakeOver failed!");
                                return -1;
@@ -1529,7 +1529,7 @@ hc_interrupt (void)
        /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
        if (ints & OHCI_INTR_SF) {
                unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1;
-               wait_ms(1);
+               mdelay(1);
                writel (OHCI_INTR_SF, &regs->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, &regs->intrenable);
index 4fb7031203853940d0d26b4ff13e483a32930310..14c6a280a6269e9912af04bb5275df7f310aac3d 100644 (file)
@@ -1274,7 +1274,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
@@ -1377,7 +1377,7 @@ static int hc_reset (ohci_t *ohci)
                writel (OHCI_OCR, &ohci->regs->cmdstatus); /* request ownership */
                info("USB HC TakeOver from SMM");
                while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
-                       wait_ms (10);
+                       mdelay (10);
                        if (--smm_timeout == 0) {
                                err("USB HC TakeOver failed!");
                                return -1;
@@ -1534,7 +1534,7 @@ hc_interrupt (void)
        /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
        if (ints & OHCI_INTR_SF) {
                unsigned int frame = ohci_cpu_to_le16 (ohci->hcca->frame_no) & 1;
-               wait_ms(1);
+               mdelay(1);
                writel (OHCI_INTR_SF, &regs->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, &regs->intrenable);
index 358e52afc2ded388c350a5555de90f1c3466fe58..62cc25dc929cc461d3e98c8624aaa9767c40b6b3 100644 (file)
@@ -515,9 +515,9 @@ void reset_hc(void)
        out16r(usb_base_addr + USBCMD, USBCMD_GRESET | USBCMD_RS);
        /* Turn off all interrupts */
        out16r(usb_base_addr + USBINTR, 0);
-       wait_ms(50);
+       mdelay(50);
        out16r(usb_base_addr + USBCMD, 0);
-       wait_ms(10);
+       mdelay(10);
 }
 
 void start_hc(void)
@@ -1044,7 +1044,7 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        status = (status & 0xfff5) | USBPORTSC_PR;
                        out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
                               status);
-                       wait_ms(10);
+                       mdelay(10);
                        status = (status & 0xfff5) & ~USBPORTSC_PR;
                        out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
                               status);
@@ -1052,7 +1052,7 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        status = (status & 0xfff5) | USBPORTSC_PE;
                        out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
                               status);
-                       wait_ms(10);
+                       mdelay(10);
                        status = (status & 0xfff5) | 0xa;
                        out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
                               status);
index ac2d2e966f41d40d7cba4eec67943f63510d76e4..618b39d142ac9bf5ae8b739959f473748ab467d2 100644 (file)
@@ -187,7 +187,7 @@ void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
 
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
 
-       wait_ms(50);
+       mdelay(50);
 
        /* terminate the reset */
        *reg = ehci_readl(status_reg);
index 4152873845d4d70f6f6a50cd2e4e8b959b538f6e..b9ff311eb90504170e105217009f113fe1bd3fd1 100644 (file)
@@ -284,7 +284,7 @@ int au_do_update(int idx, long sz)
         */
        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
        flash_sect_erase(start, end);
-       wait_ms(100);
+       mdelay(100);
 #ifdef CONFIG_PROGRESSBAR
        show_progress(end - start, totsize);
 #endif
@@ -352,7 +352,7 @@ int do_auto_update(void)
         * Read keypad status
         */
        i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status1, 2);
-       wait_ms(500);
+       mdelay(500);
        i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status2, 2);
 
        /*
index 89d2e0a4b667f98946d8cc894cd06ac8899ffef2..ddca58736986e26289fb726afc726db8d9f04502 100644 (file)
@@ -435,9 +435,9 @@ void reset_hc(void)
        out16r( usb_base_addr + USBCMD,USBCMD_GRESET | USBCMD_RS);
        /* Turn off all interrupts */
        out16r(usb_base_addr + USBINTR,0);
-       wait_ms(50);
+       mdelay(50);
        out16r( usb_base_addr + USBCMD,0);
-       wait_ms(10);
+       mdelay(10);
 }
 
 void start_hc(void)
@@ -926,13 +926,13 @@ int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                        status = in16r(usb_base_addr+USBPORTSC1+2*(wIndex-1));
                        status = (status & 0xfff5) | USBPORTSC_PR;
                        out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
-                       wait_ms(10);
+                       mdelay(10);
                        status = (status & 0xfff5) & ~USBPORTSC_PR;
                        out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
                        udelay(10);
                        status = (status & 0xfff5) | USBPORTSC_PE;
                        out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
-                       wait_ms(10);
+                       mdelay(10);
                        status = (status & 0xfff5) | 0xa;
                        out16r(usb_base_addr+USBPORTSC1+2*(wIndex-1),status);
                        len=0;
index 6d92c8362e796f66a955f0746f8c3268e2660091..2cd2ad0cea16796a5a616e2930f265a6ea60828e 100644 (file)
 
 #define SM107_DEVICEID         (0x13e00060 + NOCACHE_OFFSET)
 
-static void wait_ms(unsigned long time)
-{
-       while (time--)
-               udelay(1000);
-}
-
 static void test_pld(void)
 {
        printf("PLD version = %04x\n", readb(PLD_VERSR));
@@ -53,10 +47,10 @@ static void test_led(void)
 {
        printf("turn on LEDs 3, 5, 7, 9\n");
        writeb(0x55, PLD_LEDCR);
-       wait_ms(2000);
+       mdelay(2000);
        printf("turn on LEDs 4, 6, 8, 10\n");
        writeb(0xaa, PLD_LEDCR);
-       wait_ms(2000);
+       mdelay(2000);
        writeb(0x00, PLD_LEDCR);
 }
 
index 3c9ede4b8e5cfd57c26775ec3cb1cf21d7bcbeda..1ec30bc058f708ea46b612aff8d3f3340b5dca68 100644 (file)
@@ -81,16 +81,6 @@ char usb_started; /* flag for the started/stopped USB status */
  */
 static void usb_scan_devices(void);
 
-/***********************************************************************
- * wait_ms
- */
-
-inline void wait_ms(unsigned long ms)
-{
-       while (ms-- > 0)
-               udelay(1000);
-}
-
 /***************************************************************************
  * Init USB Device
  */
@@ -209,7 +199,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
        while (timeout--) {
                if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
                        break;
-               wait_ms(1);
+               mdelay(1);
        }
        if (dev->status)
                return -1;
@@ -233,7 +223,7 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
        while (timeout--) {
                if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
                        break;
-               wait_ms(1);
+               mdelay(1);
        }
        *actual_length = dev->act_len;
        if (dev->status == 0)
@@ -897,7 +887,7 @@ int usb_new_device(struct usb_device *dev)
                return 1;
        }
 
-       wait_ms(10);    /* Let the SET_ADDRESS settle */
+       mdelay(10);     /* Let the SET_ADDRESS settle */
 
        tmp = sizeof(dev->descriptor);
 
index 84d0d3f9c1881933a5acb7bd8caa631625f8684f..e0edaad56b4daab3671cbdd48af6936ff5a5d2a1 100644 (file)
@@ -120,7 +120,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
        }
 
        /* Wait at least 100 msec for power to become stable */
-       wait_ms(max(pgood_delay, (unsigned)100));
+       mdelay(max(pgood_delay, (unsigned)100));
 }
 
 void usb_hub_reset(void)
@@ -160,7 +160,7 @@ int hub_port_reset(struct usb_device *dev, int port,
        for (tries = 0; tries < MAX_TRIES; tries++) {
 
                usb_set_port_feature(dev, port + 1, USB_PORT_FEAT_RESET);
-               wait_ms(200);
+               mdelay(200);
 
                if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
                        USB_HUB_PRINTF("get_port_status failed status %lX\n",
@@ -187,7 +187,7 @@ int hub_port_reset(struct usb_device *dev, int port,
                if (portstatus & USB_PORT_STAT_ENABLE)
                        break;
 
-               wait_ms(200);
+               mdelay(200);
        }
 
        if (tries == MAX_TRIES) {
@@ -232,7 +232,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
                if (!(portstatus & USB_PORT_STAT_CONNECTION))
                        return;
        }
-       wait_ms(200);
+       mdelay(200);
 
        /* Reset the port */
        if (hub_port_reset(dev, port, &portstatus) < 0) {
@@ -240,7 +240,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
                return;
        }
 
-       wait_ms(200);
+       mdelay(200);
 
        /* Allocate a new device struct for it */
        usb = usb_alloc_new_device();
index de84c8d7d0185ddb2a5ab986a74f936473ec3428..12083337b01e74610be23b94c467ee8ef3eb0d64 100644 (file)
@@ -438,19 +438,19 @@ static int usb_stor_BBB_reset(struct us_data *us)
        }
 
        /* long wait for reset */
-       wait_ms(150);
+       mdelay(150);
        USB_STOR_PRINTF("BBB_reset result %d: status %lX reset\n", result,
                        us->pusb_dev->status);
        pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
        result = usb_clear_halt(us->pusb_dev, pipe);
        /* long wait for reset */
-       wait_ms(150);
+       mdelay(150);
        USB_STOR_PRINTF("BBB_reset result %d: status %lX clearing IN endpoint\n",
                        result, us->pusb_dev->status);
        /* long wait for reset */
        pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
        result = usb_clear_halt(us->pusb_dev, pipe);
-       wait_ms(150);
+       mdelay(150);
        USB_STOR_PRINTF("BBB_reset result %d: status %lX"
                        " clearing OUT endpoint\n", result,
                        us->pusb_dev->status);
@@ -478,7 +478,7 @@ static int usb_stor_CB_reset(struct us_data *us)
                                 USB_CNTL_TIMEOUT * 5);
 
        /* long wait for reset */
-       wait_ms(1500);
+       mdelay(1500);
        USB_STOR_PRINTF("CB_reset result %d: status %lX"
                        " clearing endpoint halt\n", result,
                        us->pusb_dev->status);
@@ -621,7 +621,7 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
        while (timeout--) {
                if ((volatile int *) us->ip_wanted == 0)
                        break;
-               wait_ms(10);
+               mdelay(10);
        }
        if (us->ip_wanted) {
                printf("        Did not get interrupt on CBI\n");
@@ -692,7 +692,7 @@ int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
                usb_stor_BBB_reset(us);
                return USB_STOR_TRANSPORT_FAILED;
        }
-       wait_ms(5);
+       mdelay(5);
        pipein = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
        pipeout = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
        /* DATA phase + error handling */
@@ -884,7 +884,7 @@ do_retry:
                                srb->sense_buf[12], srb->sense_buf[13]);
                        return USB_STOR_TRANSPORT_FAILED;
                } else {
-                       wait_ms(100);
+                       mdelay(100);
                        goto do_retry;
                }
                break;
@@ -960,7 +960,7 @@ static int usb_test_unit_ready(ccb *srb, struct us_data *ss)
                if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
                        return 0;
                usb_request_sense(srb, ss);
-               wait_ms(100);
+               mdelay(100);
        } while (retries--);
 
        return -1;
index d6fee814ca891df2da207220e39c7aaebf2a0908..ef5afc22b04c5f25f322d6897c9aad8e60c4e80d 100644 (file)
@@ -776,7 +776,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
                goto unknown;
        }
 
-       wait_ms(1);
+       mdelay(1);
        len = min3(srclen, le16_to_cpu(req->length), length);
        if (srcptr != NULL && len > 0)
                memcpy(buffer, srcptr, len);
@@ -857,7 +857,7 @@ int usb_lowlevel_init(void)
        ehci_writel(&hcor->or_configflag, cmd);
        /* unblock posted write */
        cmd = ehci_readl(&hcor->or_usbcmd);
-       wait_ms(5);
+       mdelay(5);
        reg = HC_VERSION(ehci_readl(&hccr->cr_capbase));
        printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
 
index abdcbb4b22533a1aacf34c76a9962a07f36139d5..5ef34c30fd964e64ad1d0bb66550b6364344d0c5 100644 (file)
@@ -578,7 +578,7 @@ static int isp116x_interrupt(struct isp116x *isp116x)
                        /* When root hub or any of its ports is going
                           to come out of suspend, it may take more
                           than 10ms for status bits to stabilize. */
-                       wait_ms(20);
+                       mdelay(20);
                }
 
                if (intstat & HCINT_SO) {
@@ -679,7 +679,7 @@ retry_same:
        /* Pack data into FIFO ram */
        pack_fifo(isp116x, dev, pipe, ptd, 1, buffer, len);
 #ifdef EXTRA_DELAY
-       wait_ms(EXTRA_DELAY);
+       mdelay(EXTRA_DELAY);
 #endif
 
        /* Start the data transfer */
@@ -983,11 +983,11 @@ static int isp116x_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
                                                       HCRHPORT1 + wIndex - 1);
                                if (!(tmp & RH_PS_PRS))
                                        break;
-                               wait_ms(1);
+                               mdelay(1);
                        }
                        isp116x_write_reg32(isp116x, HCRHPORT1 + wIndex - 1,
                                            RH_PS_PRS);
-                       wait_ms(10);
+                       mdelay(10);
 
                        len = 0;
                        break;
@@ -1251,7 +1251,7 @@ static int isp116x_sw_reset(struct isp116x *isp116x)
        isp116x_write_reg32(isp116x, HCCMDSTAT, HCCMDSTAT_HCR);
        while (--retries) {
                /* It usually resets within 1 ms */
-               wait_ms(1);
+               mdelay(1);
                if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & HCCMDSTAT_HCR))
                        break;
        }
@@ -1278,7 +1278,7 @@ static int isp116x_reset(struct isp116x *isp116x)
                clkrdy = isp116x_read_reg16(isp116x, HCuPINT) & HCuPINT_CLKRDY;
                if (clkrdy)
                        break;
-               wait_ms(1);
+               mdelay(1);
        }
        if (!clkrdy) {
                ERR("clock not ready after %dms", timeout);
index 1a428e95aeb0963d79e2b8332acb8385e5f8af14..d24f2f1314b2966fb78ee687088e0b34f29b0449 100644 (file)
@@ -1279,7 +1279,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 pkt_print(NULL, dev, pipe, buffer, transfer_len,
          cmd, "SUB(rh)", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (usb_pipeint(pipe)) {
                info("Root-Hub submit IRQ: NOT implemented");
@@ -1360,7 +1360,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
                        OK(0);
                case (RH_PORT_POWER):
                        WR_RH_PORTSTAT(RH_PS_PPS);
-                       wait_ms(100);
+                       mdelay(100);
                        OK(0);
                case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
                        if (RD_RH_PORTSTAT & RH_PS_CCS)
@@ -1465,7 +1465,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
 #ifdef DEBUG
        ohci_dump_roothub(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
@@ -1478,7 +1478,7 @@ pkt_print(NULL, dev, pipe, buffer, transfer_len,
        pkt_print(NULL, dev, pipe, buffer,
                  transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        return stat;
@@ -1516,7 +1516,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(urb, dev, pipe, buffer, transfer_len,
                  setup, "SUB", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_common_message: pipesize for pipe %lx is zero",
@@ -1530,7 +1530,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        }
 
 #if 0
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 #endif
 
@@ -1560,7 +1560,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb->finished)
                                dbg("*");
 
@@ -1580,7 +1580,7 @@ int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(urb, dev, pipe, buffer, transfer_len,
                  setup, "RET(ctlr)", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        /* free TDs in urb_priv */
@@ -1607,7 +1607,7 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
        pkt_print(NULL, dev, pipe, buffer, transfer_len,
                  setup, "SUB", usb_pipein(pipe));
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        if (!maxsize) {
                err("submit_control_message: pipesize for pipe %lx is zero",
@@ -1677,7 +1677,7 @@ static int hc_reset(ohci_t *ohci)
                ohci_writel(OHCI_OCR, &ohci->regs->cmdstatus);
                info("USB HC TakeOver from SMM");
                while (ohci_readl(&ohci->regs->control) & OHCI_CTRL_IR) {
-                       wait_ms(10);
+                       mdelay(10);
                        if (--smm_timeout == 0) {
                                err("USB HC TakeOver failed!");
                                return -1;
@@ -1813,7 +1813,7 @@ static int hc_interrupt(void)
 #ifdef DEBUG
                ohci_dump(ohci, 1);
 #else
-               wait_ms(1);
+               mdelay(1);
 #endif
                /* FIXME: be optimistic, hope that bug won't repeat often. */
                /* Make some non-interrupt context restart the controller. */
@@ -1824,7 +1824,7 @@ static int hc_interrupt(void)
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
                ohci_writel(OHCI_INTR_WDH, &regs->intrdisable);
                (void)ohci_readl(&regs->intrdisable); /* flush */
                stat = dl_done_list(&gohci);
@@ -1841,7 +1841,7 @@ static int hc_interrupt(void)
        /* FIXME:  this assumes SOF (1/ms) interrupts don't get lost... */
        if (ints & OHCI_INTR_SF) {
                unsigned int frame = m16_swap(ohci->hcca->frame_no) & 1;
-               wait_ms(1);
+               mdelay(1);
                ohci_writel(OHCI_INTR_SF, &regs->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        ohci_writel(OHCI_INTR_SF, &regs->intrenable);
@@ -1973,7 +1973,7 @@ int usb_lowlevel_init(void)
 #ifdef DEBUG
        ohci_dump(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        return 0;
index aa753d800cb97f18c1bf055db61889c66353e1a7..ab1b8d0d8bec8bda3d06a46e31ac95aa941a3fa2 100644 (file)
@@ -497,7 +497,7 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
 
        old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
        while (count > 0) {
-               wait_ms(R8A66597_RH_POLL_TIME);
+               mdelay(R8A66597_RH_POLL_TIME);
 
                syssts = r8a66597_read(r8a66597, get_syssts_reg(port) & LNST);
                if (syssts == old_syssts) {
@@ -511,11 +511,11 @@ static void r8a66597_check_syssts(struct r8a66597 *r8a66597, int port)
 
 static void r8a66597_bus_reset(struct r8a66597 *r8a66597, int port)
 {
-       wait_ms(10);
+       mdelay(10);
        r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, get_dvstctr_reg(port));
-       wait_ms(50);
+       mdelay(50);
        r8a66597_mdfy(r8a66597, UACT, USBRST | UACT, get_dvstctr_reg(port));
-       wait_ms(50);
+       mdelay(50);
 }
 
 static int check_usb_device_connecting(struct r8a66597 *r8a66597)
@@ -823,7 +823,7 @@ static int r8a66597_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
                stat = USB_ST_STALLED;
        }
 
-       wait_ms(1);
+       mdelay(1);
 
        len = min_t(int, len, leni);
 
@@ -918,7 +918,7 @@ int usb_lowlevel_init(void)
        r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
 
        disable_controller(r8a66597);
-       wait_ms(100);
+       mdelay(100);
 
        enable_controller(r8a66597);
        r8a66597_port_power(r8a66597, 0 , 1);
@@ -926,7 +926,7 @@ int usb_lowlevel_init(void)
        /* check usb device */
        check_usb_device_connecting(r8a66597);
 
-       wait_ms(50);
+       mdelay(50);
 
        return 0;
 }
index 4534738f8d7350ffdc9f311558de1396602c6dd4..48e4bcda54640fbf1a0d8c3feecba09236cd2341 100644 (file)
@@ -199,7 +199,6 @@ int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
                        void *buffer, int transfer_len, int interval);
 int usb_disable_asynch(int disable);
 int usb_maxpacket(struct usb_device *dev, unsigned long pipe);
-inline void wait_ms(unsigned long ms);
 int usb_get_configuration_no(struct usb_device *dev, unsigned char *buffer,
                                int cfgno);
 int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type,