LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] spi: rockchip-sfc: Remove redundant IO operations
@ 2021-08-21 12:49 Jon Lin
  2021-08-23 17:37 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Lin @ 2021-08-21 12:49 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Jon Lin, Mark Brown, linux-kernel, linux-spi, linux-rockchip,
	linux-arm-kernel

Coherent dma buffer is uncached and memcpy is enough.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
---

 drivers/spi/spi-rockchip-sfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 7c4d47fe80c2..81154a8836fc 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -453,7 +453,7 @@ static int rockchip_sfc_xfer_data_dma(struct rockchip_sfc *sfc,
 	dev_dbg(sfc->dev, "sfc xfer_dma len=%x\n", len);
 
 	if (op->data.dir == SPI_MEM_DATA_OUT)
-		memcpy_toio(sfc->buffer, op->data.buf.out, len);
+		memcpy(sfc->buffer, op->data.buf.out, len);
 
 	ret = rockchip_sfc_fifo_transfer_dma(sfc, sfc->dma_buffer, len);
 	if (!wait_for_completion_timeout(&sfc->cp, msecs_to_jiffies(2000))) {
@@ -462,7 +462,7 @@ static int rockchip_sfc_xfer_data_dma(struct rockchip_sfc *sfc,
 	}
 	rockchip_sfc_irq_mask(sfc, SFC_IMR_DMA);
 	if (op->data.dir == SPI_MEM_DATA_IN)
-		memcpy_fromio(op->data.buf.in, sfc->buffer, len);
+		memcpy(op->data.buf.in, sfc->buffer, len);
 
 	return ret;
 }
-- 
2.17.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-23 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21 12:49 [PATCH] spi: rockchip-sfc: Remove redundant IO operations Jon Lin
2021-08-23 17:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).