[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f3f0b35-b13e-438c-bf55-7fb0064b61cf@linaro.org>
Date: Mon, 3 Jun 2024 23:53:37 +0100
From: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mark Brown <broonie@...nel.org>, Yang Yingliang <yangyingliang@...wei.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Thangaraj Samynathan <thangaraj.s@...rochip.com>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org
Cc: Serge Semin <fancer.lancer@...il.com>, Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
NĂcolas F . R . A . Prado <nfraprado@...labora.com>,
Neil Armstrong <neil.armstrong@...aro.org>
Subject: Re: [PATCH v1 7/8] spi: qup: Use new spi_xfer_is_dma_mapped() helper
On 31/05/2024 20:42, Andy Shevchenko wrote:
> Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/spi/spi-qup.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
> index 2af63040ac6e..06da4aa7eeb7 100644
> --- a/drivers/spi/spi-qup.c
> +++ b/drivers/spi/spi-qup.c
> @@ -5,6 +5,8 @@
>
> #include <linux/clk.h>
> #include <linux/delay.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/dmaengine.h>
> #include <linux/err.h>
> #include <linux/interconnect.h>
> #include <linux/interrupt.h>
> @@ -16,8 +18,7 @@
> #include <linux/pm_opp.h>
> #include <linux/pm_runtime.h>
> #include <linux/spi/spi.h>
> -#include <linux/dmaengine.h>
> -#include <linux/dma-mapping.h>
> +#include "internals.h"
>
> #define QUP_CONFIG 0x0000
> #define QUP_STATE 0x0004
> @@ -709,9 +710,7 @@ static int spi_qup_io_prep(struct spi_device *spi, struct spi_transfer *xfer)
>
> if (controller->n_words <= (controller->in_fifo_sz / sizeof(u32)))
> controller->mode = QUP_IO_M_MODE_FIFO;
> - else if (spi->controller->can_dma &&
> - spi->controller->can_dma(spi->controller, spi, xfer) &&
> - spi->controller->cur_msg_mapped)
> + else if (spi_xfer_is_dma_mapped(spi->controller, spi, xfer))
> controller->mode = QUP_IO_M_MODE_BAM;
> else
> controller->mode = QUP_IO_M_MODE_BLOCK;
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
Powered by blists - more mailing lists