]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/designware_udc.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / usb / gadget / designware_udc.c
index 1aab31bbae9511b79ade67dd7bd96e6b6a1aed1e..fa947dade6819f7b7c61110125395fb8e25d45cf 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Based on drivers/usb/gadget/omap1510_udc.c
  * TI OMAP1510 USB bus interface driver
  *
  * (C) Copyright 2009
  * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -14,6 +13,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 +268,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 +284,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 +600,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";