All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel()
@ 2013-04-22 13:57 Shawn Guo
  2013-04-22 14:16 ` Lars-Peter Clausen
  2013-04-23 10:35 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Shawn Guo @ 2013-04-22 13:57 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Lars-Peter Clausen, Shawn Guo

dma_request_slave_channel() is a more appropriate API for dmaengine
clients that adopt generic DMA bindings to call.  Let's use it instead
of of_dma_request_slave_channel() to save <linux/of_dma.h> include.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 sound/soc/soc-generic-dmaengine-pcm.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 98e1310..e29ec3c 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -21,7 +21,6 @@
 #include <sound/soc.h>
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
-#include <linux/of_dma.h>
 
 #include <sound/dmaengine_pcm.h>
 
@@ -219,19 +218,19 @@ static const char * const dmaengine_pcm_dma_channel_names[] = {
 };
 
 static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
-	struct device_node *of_node)
+	struct device *dev)
 {
 	unsigned int i;
 
-	if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !of_node)
+	if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !dev->of_node)
 		return;
 
 	if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) {
-		pcm->chan[0] = of_dma_request_slave_channel(of_node, "rx-tx");
+		pcm->chan[0] = dma_request_slave_channel(dev, "rx-tx");
 		pcm->chan[1] = pcm->chan[0];
 	} else {
 		for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
-			pcm->chan[i] = of_dma_request_slave_channel(of_node,
+			pcm->chan[i] = dma_request_slave_channel(dev,
 					dmaengine_pcm_dma_channel_names[i]);
 		}
 	}
@@ -255,7 +254,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
 	pcm->config = config;
 	pcm->flags = flags;
 
-	dmaengine_pcm_request_chan_of(pcm, dev->of_node);
+	dmaengine_pcm_request_chan_of(pcm, dev);
 
 	if (flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
 		return snd_soc_add_platform(dev, &pcm->platform,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel()
  2013-04-22 13:57 [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel() Shawn Guo
@ 2013-04-22 14:16 ` Lars-Peter Clausen
  2013-04-23 10:35 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2013-04-22 14:16 UTC (permalink / raw)
  To: Shawn Guo; +Cc: alsa-devel, Mark Brown

On 04/22/2013 03:57 PM, Shawn Guo wrote:
> dma_request_slave_channel() is a more appropriate API for dmaengine
> clients that adopt generic DMA bindings to call.  Let's use it instead
> of of_dma_request_slave_channel() to save <linux/of_dma.h> include.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

I'm not a 100% convinced about this one, but I guess it wont hurt, so

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>  sound/soc/soc-generic-dmaengine-pcm.c |   11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index 98e1310..e29ec3c 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -21,7 +21,6 @@
>  #include <sound/soc.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/of.h>
> -#include <linux/of_dma.h>
>  
>  #include <sound/dmaengine_pcm.h>
>  
> @@ -219,19 +218,19 @@ static const char * const dmaengine_pcm_dma_channel_names[] = {
>  };
>  
>  static void dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
> -	struct device_node *of_node)
> +	struct device *dev)
>  {
>  	unsigned int i;
>  
> -	if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !of_node)
> +	if ((pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_DT) || !dev->of_node)
>  		return;
>  
>  	if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX) {
> -		pcm->chan[0] = of_dma_request_slave_channel(of_node, "rx-tx");
> +		pcm->chan[0] = dma_request_slave_channel(dev, "rx-tx");
>  		pcm->chan[1] = pcm->chan[0];
>  	} else {
>  		for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
> -			pcm->chan[i] = of_dma_request_slave_channel(of_node,
> +			pcm->chan[i] = dma_request_slave_channel(dev,
>  					dmaengine_pcm_dma_channel_names[i]);
>  		}
>  	}
> @@ -255,7 +254,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
>  	pcm->config = config;
>  	pcm->flags = flags;
>  
> -	dmaengine_pcm_request_chan_of(pcm, dev->of_node);
> +	dmaengine_pcm_request_chan_of(pcm, dev);
>  
>  	if (flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
>  		return snd_soc_add_platform(dev, &pcm->platform,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel()
  2013-04-22 13:57 [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel() Shawn Guo
  2013-04-22 14:16 ` Lars-Peter Clausen
@ 2013-04-23 10:35 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-04-23 10:35 UTC (permalink / raw)
  To: Shawn Guo; +Cc: alsa-devel, Lars-Peter Clausen


[-- Attachment #1.1: Type: text/plain, Size: 290 bytes --]

On Mon, Apr 22, 2013 at 09:57:24PM +0800, Shawn Guo wrote:
> dma_request_slave_channel() is a more appropriate API for dmaengine
> clients that adopt generic DMA bindings to call.  Let's use it instead
> of of_dma_request_slave_channel() to save <linux/of_dma.h> include.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-23 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 13:57 [PATCH] ASoC: generic-dmaengine-pcm: call dma_request_slave_channel() Shawn Guo
2013-04-22 14:16 ` Lars-Peter Clausen
2013-04-23 10:35 ` Mark Brown

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.