diff mbox

[4/6] ASoC: sh: Fix dma direction type

Message ID 1408285102-24538-5-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit 6c7d1dfca999f58c65ed7b10c2f0945dd92db103
Headers show

Commit Message

Lars-Peter Clausen Aug. 17, 2014, 2:18 p.m. UTC
dmaengine_prep_slave_single() expects a enum dma_transfer_direction and not a
enum dma_data_direction. Since the integer representations of both DMA_TO_DEVICE
and DMA_MEM_TO_DEV aswell as DMA_FROM_DEVICE and DMA_DEV_TO_MEM have the same
value the code worked fine even though it was using the wrong type.

Fixes the following warnings from sparse:
	sound/soc/sh/fsi.c:1307:42: warning: mixing different enum types
	sound/soc/sh/fsi.c:1307:42:     int enum dma_data_direction  versus
	sound/soc/sh/fsi.c:1307:42:     int enum dma_transfer_direction

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/sh/fsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mark Brown Aug. 17, 2014, 2:34 p.m. UTC | #1
On Sun, Aug 17, 2014 at 04:18:20PM +0200, Lars-Peter Clausen wrote:
> dmaengine_prep_slave_single() expects a enum dma_transfer_direction and not a
> enum dma_data_direction. Since the integer representations of both DMA_TO_DEVICE
> and DMA_MEM_TO_DEV aswell as DMA_FROM_DEVICE and DMA_DEV_TO_MEM have the same
> value the code worked fine even though it was using the wrong type.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index c763443..66fddec 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1297,9 +1297,14 @@  static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
 	struct snd_pcm_substream *substream = io->substream;
 	struct dma_async_tx_descriptor *desc;
 	int is_play = fsi_stream_is_play(fsi, io);
-	enum dma_data_direction dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+	enum dma_transfer_direction dir;
 	int ret = -EIO;
 
+	if (is_play)
+		dir = DMA_MEM_TO_DEV;
+	else
+		dir = DMA_DEV_TO_MEM;
+
 	desc = dmaengine_prep_dma_cyclic(io->chan,
 					 substream->runtime->dma_addr,
 					 snd_pcm_lib_buffer_bytes(substream),