From: Andy Shevchenko Date: Fri, 31 May 2024 19:42:34 +0000 (+0300) Subject: spi: dw: Use new spi_xfer_is_dma_mapped() helper X-Git-Tag: v6.11-rc1~205^2~27^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0fb66b81dbf91a60fa4acbf7de26a1958410ef0a;p=thirdparty%2Fkernel%2Flinux.git spi: dw: Use new spi_xfer_is_dma_mapped() helper Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin Tested-by: Neil Armstrong # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-3-andriy.shevchenko@linux.intel.com Tested-by: NĂ­colas F. R. A. Prado Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index ddfdb903047af..431788dd848ce 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -19,6 +19,7 @@ #include #include +#include "internals.h" #include "spi-dw.h" #ifdef CONFIG_DEBUG_FS @@ -438,8 +439,7 @@ static int dw_spi_transfer_one(struct spi_controller *host, transfer->effective_speed_hz = dws->current_freq; /* Check if current transfer is a DMA transaction */ - if (host->can_dma && host->can_dma(host, spi, transfer)) - dws->dma_mapped = host->cur_msg_mapped; + dws->dma_mapped = spi_xfer_is_dma_mapped(host, spi, transfer); /* For poll mode just disable all interrupts */ dw_spi_mask_intr(dws, 0xff);