From: nicolas.ferre@microchip.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] spi: spi-atmel: Use correct enum for DMA transfer direction
Date: Mon, 26 Mar 2018 10:03:49 +0200 [thread overview]
Message-ID: <b3fff78d-2a1e-b05a-483a-f2707fece63f@microchip.com> (raw)
In-Reply-To: <20180324104800.9934-1-stefan@agner.ch>
On 24/03/2018 at 11:48, Stefan Agner wrote:
> Use enum dma_transfer_direction as required by the functions
> dmaengine_prep_slave_(sg|single)() instead of enum dma_data_direction.
> This won't change behavior in practice as the enum values are
> equivalent.
>
> This fixes two warnings when building with clang:
> drivers/spi/spi-atmel.c:771:12: warning: implicit conversion from enumeration
> type 'enum dma_data_direction' to different enumeration type
> 'enum dma_transfer_direction'
> [-Wenum-conversion]
> DMA_FROM_DEVICE,
> ^~~~~~~~~~~~~~~
> ...
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Ok:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> drivers/spi/spi-atmel.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 4a11fc0d4136..6a7844616c65 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -768,14 +768,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
> rxdesc = dmaengine_prep_slave_single(rxchan,
> as->dma_addr_rx_bbuf,
> xfer->len,
> - DMA_FROM_DEVICE,
> + DMA_DEV_TO_MEM,
> DMA_PREP_INTERRUPT |
> DMA_CTRL_ACK);
> } else {
> rxdesc = dmaengine_prep_slave_sg(rxchan,
> xfer->rx_sg.sgl,
> xfer->rx_sg.nents,
> - DMA_FROM_DEVICE,
> + DMA_DEV_TO_MEM,
> DMA_PREP_INTERRUPT |
> DMA_CTRL_ACK);
> }
> @@ -787,14 +787,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
> memcpy(as->addr_tx_bbuf, xfer->tx_buf, xfer->len);
> txdesc = dmaengine_prep_slave_single(txchan,
> as->dma_addr_tx_bbuf,
> - xfer->len, DMA_TO_DEVICE,
> + xfer->len, DMA_MEM_TO_DEV,
> DMA_PREP_INTERRUPT |
> DMA_CTRL_ACK);
> } else {
> txdesc = dmaengine_prep_slave_sg(txchan,
> xfer->tx_sg.sgl,
> xfer->tx_sg.nents,
> - DMA_TO_DEVICE,
> + DMA_MEM_TO_DEV,
> DMA_PREP_INTERRUPT |
> DMA_CTRL_ACK);
> }
>
--
Nicolas Ferre
next prev parent reply other threads:[~2018-03-26 8:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 10:48 [PATCH] spi: spi-atmel: Use correct enum for DMA transfer direction Stefan Agner
2018-03-26 8:03 ` Nicolas Ferre [this message]
2018-03-26 8:39 ` Geert Uytterhoeven
2018-03-28 2:44 ` Applied "spi: spi-atmel: Use correct enum for DMA transfer direction" to the spi tree Mark Brown
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=b3fff78d-2a1e-b05a-483a-f2707fece63f@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).