linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Yang Yingliang <yangyingliang@huawei.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Thangaraj Samynathan <thangaraj.s@microchip.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org
Cc: "Serge Semin" <fancer.lancer@gmail.com>,
	"Daniel Mack" <daniel@zonque.org>,
	"Haojian Zhuang" <haojian.zhuang@gmail.com>,
	"Robert Jarzmik" <robert.jarzmik@free.fr>,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>
Subject: [PATCH v1 4/8] spi: omap2-mcspi: Use new spi_xfer_is_dma_mapped() helper
Date: Fri, 31 May 2024 22:42:36 +0300	[thread overview]
Message-ID: <20240531194723.1761567-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com>

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>
---
 drivers/spi/spi-omap2-mcspi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 7e3083b83534..b624cc472857 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -27,6 +27,8 @@
 
 #include <linux/spi/spi.h>
 
+#include "internals.h"
+
 #include <linux/platform_data/spi-omap2-mcspi.h>
 
 #define OMAP2_MCSPI_MAX_FREQ		48000000
@@ -1208,8 +1210,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,
 		unsigned	count;
 
 		if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) &&
-		    ctlr->cur_msg_mapped &&
-		    ctlr->can_dma(ctlr, spi, t))
+		    spi_xfer_is_dma_mapped(ctlr, spi, t))
 			omap2_mcspi_set_fifo(spi, t, 1);
 
 		omap2_mcspi_set_enable(spi, 1);
@@ -1220,8 +1221,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,
 					+ OMAP2_MCSPI_TX0);
 
 		if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) &&
-		    ctlr->cur_msg_mapped &&
-		    ctlr->can_dma(ctlr, spi, t))
+		    spi_xfer_is_dma_mapped(ctlr, spi, t))
 			count = omap2_mcspi_txrx_dma(spi, t);
 		else
 			count = omap2_mcspi_txrx_pio(spi, t);
-- 
2.43.0.rc1.1336.g36b5255a03ac


  parent reply	other threads:[~2024-05-31 19:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 19:42 [PATCH v1 0/8] spi: Rework DMA mapped flag Andy Shevchenko
2024-05-31 19:42 ` [PATCH v1 1/8] spi: Introduce internal spi_xfer_is_dma_mapped() helper Andy Shevchenko
2024-06-03 22:53   ` Bryan O'Donoghue
2024-05-31 19:42 ` [PATCH v1 2/8] spi: dw: Use new " Andy Shevchenko
2024-06-03  8:28   ` Serge Semin
2024-05-31 19:42 ` [PATCH v1 3/8] spi: ingenic: " Andy Shevchenko
2024-05-31 19:42 ` Andy Shevchenko [this message]
2024-05-31 19:42 ` [PATCH v1 5/8] spi: pxa2xx: " Andy Shevchenko
2024-06-03 19:21   ` Andy Shevchenko
2024-06-05 21:12     ` Andy Shevchenko
2024-05-31 19:42 ` [PATCH v1 6/8] spi: pci1xxxx: " Andy Shevchenko
2024-05-31 19:42 ` [PATCH v1 7/8] spi: qup: " Andy Shevchenko
2024-06-03 22:53   ` Bryan O'Donoghue
2024-05-31 19:42 ` [PATCH v1 8/8] spi: Rework per message DMA mapped flag to be per transfer Andy Shevchenko
2024-06-03  9:10 ` [PATCH v1 0/8] spi: Rework DMA mapped flag Neil Armstrong
2024-06-03 19:54   ` Andy Shevchenko
2024-06-03 19:49 ` Nícolas F. R. A. Prado
2024-06-03 19:53   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240531194723.1761567-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=daniel@zonque.org \
    --cc=fancer.lancer@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nfraprado@collabora.com \
    --cc=robert.jarzmik@free.fr \
    --cc=thangaraj.s@microchip.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).