]> git.sur5r.net Git - u-boot/blobdiff - common/usb.c
CMD: Remove CMD_AUTOSCRIPT, it's not used
[u-boot] / common / usb.c
index 81dcbe28113ae8e09f2320cdacec3402739b6862..1ec30bc058f708ea46b612aff8d3f3340b5dca68 100644 (file)
@@ -73,7 +73,6 @@ static struct usb_device usb_dev[USB_MAX_DEVICE];
 static int dev_index;
 static int running;
 static int asynch_allowed;
-static struct devrequest setup_packet;
 
 char usb_started; /* flag for the started/stopped USB status */
 
@@ -82,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
  */
@@ -180,6 +169,8 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
                        unsigned short value, unsigned short index,
                        void *data, unsigned short size, int timeout)
 {
+       struct devrequest setup_packet;
+
        if ((timeout == 0) && (!asynch_allowed)) {
                /* request for a asynch control pipe is not allowed */
                return -1;
@@ -208,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;
@@ -232,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)
@@ -896,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);