[PATCH] spi: mvebu: only read from bus when data is needed
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Thu Dec 8 01:39:22 PST 2016
This optimization reduced the time to transfer 40 MB at 50 Hz from
214 seconds to 203 seconds.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
drivers/spi/mvebu_spi.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
index 58ac6057afe3..68838c0ce184 100644
--- a/drivers/spi/mvebu_spi.c
+++ b/drivers/spi/mvebu_spi.c
@@ -300,12 +300,12 @@ static int mvebu_spi_do_transfer(struct spi_device *spi,
return ret;
}
- data = readl(priv->base + SPI_DATA_IN);
-
- if (rxdata)
+ if (rxdata) {
+ data = readl(priv->base + SPI_DATA_IN);
*rxdata++ = (data & 0xff);
- if (rxdata && priv->data16)
- *rxdata++ = (data >> 8) & 0xff;
+ if (priv->data16)
+ *rxdata++ = (data >> 8) & 0xff;
+ }
}
return 0;
--
2.10.2
More information about the barebox
mailing list