All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Sangbeom Kim <sbkim73@samsung.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: [PATCH 4/6] ASoC: sh: Fix dma direction type
Date: Sun, 17 Aug 2014 16:18:20 +0200	[thread overview]
Message-ID: <1408285102-24538-5-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1408285102-24538-1-git-send-email-lars@metafoo.de>

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(-)

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),
-- 
1.8.0

  parent reply	other threads:[~2014-08-17 14:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 14:18 [PATCH 0/6] Fix `sparse` warnings Lars-Peter Clausen
2014-08-17 14:18 ` [PATCH 1/6] ASoC: edma-pcm: Include edma-pcm.h Lars-Peter Clausen
2014-08-17 14:31   ` Mark Brown
2014-08-17 14:18 ` [PATCH 2/6] ASoC: odrodix2_max98090: Make non exported symbols static Lars-Peter Clausen
2014-08-17 14:32   ` Mark Brown
2014-08-17 14:18 ` [PATCH 3/6] ASoC: rcar: Use && instead of & for boolean expressions Lars-Peter Clausen
2014-08-17 14:33   ` Mark Brown
2014-08-17 14:18 ` Lars-Peter Clausen [this message]
2014-08-17 14:34   ` [PATCH 4/6] ASoC: sh: Fix dma direction type Mark Brown
2014-08-17 14:18 ` [PATCH 5/6] ASoC: samsung idma: Add proper annotation for casting iomem pointers Lars-Peter Clausen
2014-08-17 14:35   ` Mark Brown
2014-08-17 14:18 ` [PATCH 6/6] ASoC: ab8500-codec: Drop bank prefix from AB8500_GPIO_DIR4_REG register define Lars-Peter Clausen
2014-08-17 14:36   ` 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=1408285102-24538-5-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sbkim73@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.