]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/designware_udc.c
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
[u-boot] / drivers / usb / gadget / designware_udc.c
index 1aab31bbae9511b79ade67dd7bd96e6b6a1aed1e..a25f5019e8a70b482f9f3a6fe35e7340053bef2e 100644 (file)
@@ -14,6 +14,7 @@
 #include <usbdevice.h>
 #include "ep0.h"
 #include <usb/designware_udc.h>
+#include <usb/udc.h>
 #include <asm/arch/hardware.h>
 
 #define UDC_INIT_MDELAY                80      /* Device settle delay */
@@ -268,8 +269,8 @@ static void dw_write_noniso_tx_fifo(struct usb_endpoint_instance
                UDCDBGA("urb->buffer %p, buffer_length %d, actual_length %d",
                        urb->buffer, urb->buffer_length, urb->actual_length);
 
-               last = MIN(urb->actual_length - endpoint->sent,
-                          endpoint->tx_packetSize);
+               last = min_t(u32, urb->actual_length - endpoint->sent,
+                            endpoint->tx_packetSize);
 
                if (last) {
                        u8 *cp = urb->buffer + endpoint->sent;
@@ -284,7 +285,7 @@ static void dw_write_noniso_tx_fifo(struct usb_endpoint_instance
 
                        align = ((ulong)cp % sizeof(int));
                        if (align)
-                               last = MIN(last, sizeof(int) - align);
+                               last = min(last, sizeof(int) - align);
 
                        UDCDBGA("endpoint->sent %d, tx_packetSize %d, last %d",
                                endpoint->sent, endpoint->tx_packetSize, last);
@@ -600,7 +601,7 @@ void udc_setup_ep(struct usb_device_instance *device,
        if ((ep != 0) && (udc_device->device_state < STATE_ADDRESSED))
                return;
 
-       tt = getenv("usbtty");
+       tt = env_get("usbtty");
        if (!tt)
                tt = "generic";