mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] spi: use dmaengine public API instead of raw ops
@ 2026-09-30 14:02 Frank.Li
  2026-09-30 14:02 ` [PATCH v2 2/2] spi: use dmaengine_get_dma_device() instead of chan->device->dev Frank.Li
  2026-10-01 14:21 ` [PATCH v2 1/2] spi: use dmaengine public API instead of raw ops Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Frank.Li @ 2026-09-30 14:02 UTC (permalink / raw)
  To: Radu Pirea, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Ryan Wanner,
	open list:MICROCHIP AT91 USART SPI DRIVER,
	moderated list:ARM/Microchip (AT91) SoC support, open list
  Cc: vkoul, imx, Frank Li

From: Frank Li <Frank.Li@nxp.com>

Replace direct calls to the internal DMA device ops
device->device_issue_pending() with the proper public DMA engine wrappers:
dma_async_issue_pending().

Drivers must not call device ops directly; the wrappers provide locking,
debug checks, and a stable interface that hides internal implementation
details of the DMA controller driver.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Change in v2
- none
---
 drivers/spi/spi-at91-usart.c | 4 ++--
 drivers/spi/spi-atmel.c      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 804f6194c830f..cdc771350db93 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -239,8 +239,8 @@ static int at91_usart_spi_dma_transfer(struct spi_controller *ctlr,
 	if (dma_submit_error(cookie))
 		goto at91_usart_spi_err_dma;
 
-	rxchan->device->device_issue_pending(rxchan);
-	txchan->device->device_issue_pending(txchan);
+	dma_async_issue_pending(rxchan);
+	dma_async_issue_pending(txchan);
 
 	return 0;
 
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index c8012c82c3a78..c04113ce17f70 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -877,8 +877,8 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_controller *host,
 	cookie = txdesc->tx_submit(txdesc);
 	if (dma_submit_error(cookie))
 		goto err_dma;
-	rxchan->device->device_issue_pending(rxchan);
-	txchan->device->device_issue_pending(txchan);
+	dma_async_issue_pending(rxchan);
+	dma_async_issue_pending(txchan);
 
 	return 0;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-10-01 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 14:02 [PATCH v2 1/2] spi: use dmaengine public API instead of raw ops Frank.Li
2026-09-30 14:02 ` [PATCH v2 2/2] spi: use dmaengine_get_dma_device() instead of chan->device->dev Frank.Li
2026-10-01 14:21 ` [PATCH v2 1/2] spi: use dmaengine public API instead of raw ops Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®