Merge tag 'u-boot-rockchip-20200501' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / spi / spi-mem.c
index b8cf8dd..ffbe20c 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/pm_runtime.h>
 #include "internals.h"
 #else
+#include <dm/device_compat.h>
 #include <spi.h>
 #include <spi-mem.h>
 #endif
@@ -152,7 +153,7 @@ bool spi_mem_default_supports_op(struct spi_slave *slave,
            spi_check_buswidth_req(slave, op->dummy.buswidth, true))
                return false;
 
-       if (op->data.nbytes &&
+       if (op->data.dir != SPI_MEM_NO_DATA &&
            spi_check_buswidth_req(slave, op->data.buswidth,
                                   op->data.dir == SPI_MEM_DATA_OUT))
                return false;