Merge branch 'master' of git://git.denx.de/u-boot-sh
[oweals/u-boot.git] / drivers / usb / gadget / pxa27x_udc.c
index 05d1b566674d101125d3006b0bd741fe57070e06..15c43782b807e033b74b0c0a53bf379043e9d095 100644 (file)
@@ -1,21 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * PXA27x USB device driver for u-boot.
  *
  * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
  * Copyright (C) 2007 Eurotech S.p.A.  <info@eurotech.it>
  * Copyright (C) 2008 Vivek Kutal      <vivek.kutal@azingo.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 
 #include <common.h>
-#include <config.h>
-#include <asm/byteorder.h>
-#include <usbdevice.h>
 #include <asm/arch/hardware.h>
+#include <asm/byteorder.h>
 #include <asm/io.h>
+#include <usbdevice.h>
 #include <usb/pxa27x_udc.h>
+#include <usb/udc.h>
 
 #include "ep0.h"
 
@@ -64,7 +63,8 @@ static int udc_write_urb(struct usb_endpoint_instance *endpoint)
        if (!urb || !urb->actual_length)
                return -1;
 
-       n = MIN(urb->actual_length - endpoint->sent, endpoint->tx_packetSize);
+       n = min_t(unsigned int, urb->actual_length - endpoint->sent,
+                 endpoint->tx_packetSize);
        if (n <= 0)
                return -1;