From: Andy Shevchenko Date: Fri, 31 May 2024 19:42:38 +0000 (+0300) Subject: spi: pci1xxxx: Use new spi_xfer_is_dma_mapped() helper X-Git-Tag: v6.11-rc1~205^2~27^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f9485adfbd8af088684f43c6391fa02e334d349;p=thirdparty%2Fkernel%2Flinux.git spi: pci1xxxx: 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 Tested-by: Neil Armstrong # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-7-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin Tested-by: NĂ­colas F. R. A. Prado Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c index cc18d320370f9..fc98979eba485 100644 --- a/drivers/spi/spi-pci1xxxx.c +++ b/drivers/spi/spi-pci1xxxx.c @@ -6,6 +6,7 @@ #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include "internals.h" #define DRV_NAME "spi-pci1xxxx" @@ -567,7 +568,7 @@ error: static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr, struct spi_device *spi, struct spi_transfer *xfer) { - if (spi_ctlr->can_dma(spi_ctlr, spi, xfer) && spi_ctlr->cur_msg_mapped) + if (spi_xfer_is_dma_mapped(spi_ctlr, spi, xfer)) return pci1xxxx_spi_transfer_with_dma(spi_ctlr, spi, xfer); else return pci1xxxx_spi_transfer_with_io(spi_ctlr, spi, xfer);