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");
 #ifdef DEBUG
        ohci_dump_roothub(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
        pkt_print(dev, pipe, buffer, transfer_len, cmd, "RET(rh)",
                  0 /*usb_pipein(pipe) */);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        return stat;
        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",
                return -1;
        }
 
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 
        /* allow more time for a BULK device to react - some are slow */
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
        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 */
        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",
                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;
 #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. */
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
 
                writel(OHCI_INTR_WDH, ®s->intrdisable);
                stat = dl_done_list(&gohci, dl_reverse_done_list(&gohci));
        /* 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, ®s->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel(OHCI_INTR_SF, ®s->intrenable);
        /* 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);
 #ifdef DEBUG
        ohci_dump(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        urb_finished = 1;
 
 #endif
 
        writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
-       wait_ms(11);
+       mdelay(11);
        writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
 
        writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
 
 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");
 #ifdef DEBUG
        ohci_dump_roothub (&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
                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;
        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",
                return -1;
        }
 
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 
        /* allow more time for a BULK device to react - some are slow */
                        break;
                }
                if (--timeout) {
-                       udelay(250); /* wait_ms(1); */
+                       udelay(250); /* mdelay(1); */
                } else {
                        err("CTL:TIMEOUT ");
                        stat = USB_ST_CRC_ERR;
 #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 */
        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",
                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;
 #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. */
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
                writel (OHCI_INTR_WDH, ®s->intrdisable);
                stat = dl_done_list (&gohci, dl_reverse_done_list (&gohci));
                writel (OHCI_INTR_WDH, ®s->intrenable);
        /* 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, ®s->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, ®s->intrenable);
 
        /* 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;
 #ifdef DEBUG
        ohci_dump (&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        return 0;
 
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
                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;
        /* 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, ®s->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, ®s->intrenable);
 
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb_finished)
                                dbg("\%");
 
                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;
        /* 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, ®s->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        writel (OHCI_INTR_SF, ®s->intrenable);
 
        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)
                        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);
                        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);
 
 
        ulpi_write(&ulpi_vp, &ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
 
-       wait_ms(50);
+       mdelay(50);
 
        /* terminate the reset */
        *reg = ehci_readl(status_reg);
 
         */
        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
         * 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);
 
        /*
 
        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)
                        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;
 
 
 #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));
 {
        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);
 }
 
 
  */
 static void usb_scan_devices(void);
 
-/***********************************************************************
- * wait_ms
- */
-
-inline void wait_ms(unsigned long ms)
-{
-       while (ms-- > 0)
-               udelay(1000);
-}
-
 /***************************************************************************
  * Init USB Device
  */
        while (timeout--) {
                if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
                        break;
-               wait_ms(1);
+               mdelay(1);
        }
        if (dev->status)
                return -1;
        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)
                return 1;
        }
 
-       wait_ms(10);    /* Let the SET_ADDRESS settle */
+       mdelay(10);     /* Let the SET_ADDRESS settle */
 
        tmp = sizeof(dev->descriptor);
 
 
        }
 
        /* 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)
        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",
                if (portstatus & USB_PORT_STAT_ENABLE)
                        break;
 
-               wait_ms(200);
+               mdelay(200);
        }
 
        if (tries == MAX_TRIES) {
                if (!(portstatus & USB_PORT_STAT_CONNECTION))
                        return;
        }
-       wait_ms(200);
+       mdelay(200);
 
        /* Reset the port */
        if (hub_port_reset(dev, port, &portstatus) < 0) {
                return;
        }
 
-       wait_ms(200);
+       mdelay(200);
 
        /* Allocate a new device struct for it */
        usb = usb_alloc_new_device();
 
        }
 
        /* 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);
                                 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);
        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");
                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 */
                                srb->sense_buf[12], srb->sense_buf[13]);
                        return USB_STOR_TRANSPORT_FAILED;
                } else {
-                       wait_ms(100);
+                       mdelay(100);
                        goto do_retry;
                }
                break;
                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;
 
                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);
        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);
 
 
                        /* 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) {
        /* 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 */
                                                       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;
        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;
        }
                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);
 
 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");
                        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)
 #ifdef DEBUG
        ohci_dump_roothub(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        len = min_t(int, len, leni);
        pkt_print(NULL, dev, pipe, buffer,
                  transfer_len, cmd, "RET(rh)", 0/*usb_pipein(pipe)*/);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
 
        return stat;
        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",
        }
 
 #if 0
-       wait_ms(10);
+       mdelay(10);
        /* ohci_dump_status(&gohci); */
 #endif
 
                }
 
                if (--timeout) {
-                       wait_ms(1);
+                       mdelay(1);
                        if (!urb->finished)
                                dbg("*");
 
        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 */
        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",
                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;
 #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. */
        }
 
        if (ints & OHCI_INTR_WDH) {
-               wait_ms(1);
+               mdelay(1);
                ohci_writel(OHCI_INTR_WDH, ®s->intrdisable);
                (void)ohci_readl(®s->intrdisable); /* flush */
                stat = dl_done_list(&gohci);
        /* 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, ®s->intrdisable);
                if (ohci->ed_rm_list[frame] != NULL)
                        ohci_writel(OHCI_INTR_SF, ®s->intrenable);
 #ifdef DEBUG
        ohci_dump(&gohci, 1);
 #else
-       wait_ms(1);
+       mdelay(1);
 #endif
        ohci_inited = 1;
        return 0;
 
 
        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) {
 
 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)
                stat = USB_ST_STALLED;
        }
 
-       wait_ms(1);
+       mdelay(1);
 
        len = min_t(int, len, leni);
 
        r8a66597->reg = CONFIG_R8A66597_BASE_ADDR;
 
        disable_controller(r8a66597);
-       wait_ms(100);
+       mdelay(100);
 
        enable_controller(r8a66597);
        r8a66597_port_power(r8a66597, 0 , 1);
        /* check usb device */
        check_usb_device_connecting(r8a66597);
 
-       wait_ms(50);
+       mdelay(50);
 
        return 0;
 }
 
                        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,