Skip to contentSkip to conversation

spi: spi-atmel: Use correct enum for DMA transfer direction

PATCH In review Stefan Agner 4 participants 4 messages Mar 24, 2018 – Mar 28, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: spi-atmel: Use correct enum for DMA transfer direction

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, ^~~~~~~~~~~~~~~
...

---
 drivers/spi/spi-atmel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-atmel.c +4 -4
index 4a11fc0d4136..6a7844616c65 100644
@@ -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);
 	}
Signature · 1 line
2.16.2
maintainer
#1 lore raw

PATCH 1/1 spi: spi-atmel: Use correct enum for DMA transfer direction

Quoted 14 lines · Stefan Agner

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, ^~~~~~~~~~~~~~~
...

Quoted 1 line

Ok:

Quoted 43 lines
---
  drivers/spi/spi-atmel.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-atmel.c +4 -4
index 4a11fc0d4136..6a7844616c65 100644
@@ -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);
  	}
Signature · 1 line
Nicolas Ferre
#2 lore raw

PATCH 1/1 spi: spi-atmel: Use correct enum for DMA transfer direction

In reply to Stefan Agner
Quoted 14 lines · Stefan Agner

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, ^~~~~~~~~~~~~~~
...

Quoted 1 line

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer
#3 lore raw

Applied "spi: spi-atmel: Use correct enum for DMA transfer direction" to the spi tree

In reply to Stefan Agner

The patch

spi: spi-atmel: Use correct enum for DMA transfer direction

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 357325764d7eabc4d2169d26af079b441fd48bc5 Mon Sep 17 00:00:00 2001

From: Stefan Agner <[email protected]>
Date: Sat, 24 Mar 2018 11:48:00 +0100
Subject: [PATCH] spi: spi-atmel: Use correct enum for DMA transfer direction

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, ^~~~~~~~~~~~~~~
...

---
 drivers/spi/spi-atmel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-atmel.c +4 -4
index b7936f815373..3f890d162934 100644
@@ -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);
 	}
Signature · 1 line
2.16.2