static int hub_port_reset(struct usb_device *dev, int port,
unsigned short *portstat);
-/***********************************************************************
- * 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);
for (i = 0; i < dev->maxchild; i++) {
usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
- wait_ms(hub->desc.bPwrOn2PwrGood * 2);
+ mdelay(hub->desc.bPwrOn2PwrGood * 2);
}
}
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();