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 <andriy.shevchenko@linux.intel.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD
Link: https://lore.kernel.org/r/20240531194723.1761567-7-andriy.shevchenko@linux.intel.com
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Andy Shevchenko 2024-05-31 22:42:38 +03:00 committed by Mark Brown
parent e47f923080
commit 2f9485adfb
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -6,6 +6,7 @@
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/iopoll.h> #include <linux/iopoll.h>
#include <linux/irq.h> #include <linux/irq.h>
@ -15,7 +16,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/delay.h> #include "internals.h"
#define DRV_NAME "spi-pci1xxxx" #define DRV_NAME "spi-pci1xxxx"
@ -567,7 +568,7 @@ static int pci1xxxx_spi_transfer_with_dma(struct spi_controller *spi_ctlr,
static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr, static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr,
struct spi_device *spi, struct spi_transfer *xfer) 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); return pci1xxxx_spi_transfer_with_dma(spi_ctlr, spi, xfer);
else else
return pci1xxxx_spi_transfer_with_io(spi_ctlr, spi, xfer); return pci1xxxx_spi_transfer_with_io(spi_ctlr, spi, xfer);