]> git.sur5r.net Git - u-boot/blobdiff - drivers/spi/mxc_spi.c
imx_common: detect USB serial downloader reliably
[u-boot] / drivers / spi / mxc_spi.c
index 23f2ba6223dce6d089ac6af3ac153b19d4e79844..e1562c36b7a6b5ecec5892d8ba85719cdda0e7f7 100644 (file)
@@ -7,12 +7,12 @@
 #include <common.h>
 #include <malloc.h>
 #include <spi.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
-#include <asm/imx-common/spi.h>
+#include <asm/mach-imx/spi.h>
 
 #ifdef CONFIG_MX27
 /* i.MX27 has a completely wrong register layout and register definitions in the
@@ -315,7 +315,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen,
                tmp = reg_read(&regs->rxdata);
                data = cpu_to_be32(tmp);
                debug("SPI Rx: 0x%x 0x%x\n", tmp, data);
-               cnt = min(nbytes, sizeof(data));
+               cnt = min_t(u32, nbytes, sizeof(data));
                if (din) {
                        memcpy(din, &data, cnt);
                        din += cnt;