Patchwork [1/6] ARM: mxc: make imx_dma_is_general_purpose more generic for sdma

login
register
mail settings
Submitter Richard Zhao
Date Jan. 6, 2012, 3:25 a.m.
Message ID <1325820343-11875-2-git-send-email-richard.zhao@linaro.org>
Download mbox | patch
Permalink /patch/134590/
State New
Headers show

Comments

Richard Zhao - Jan. 6, 2012, 3:25 a.m.
sdma device names vary for different SoC. So we just check
whether it includes "sdma" substring.

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
 arch/arm/plat-mxc/include/mach/dma.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Sascha Hauer - Jan. 6, 2012, 9:07 a.m.
On Fri, Jan 06, 2012 at 11:25:38AM +0800, Richard Zhao wrote:
> sdma device names vary for different SoC. So we just check
> whether it includes "sdma" substring.
> 
> Signed-off-by: Richard Zhao <richard.zhao@linaro.org>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>


> ---
>  arch/arm/plat-mxc/include/mach/dma.h |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h
> index 233d0a5..1b90803 100644
> --- a/arch/arm/plat-mxc/include/mach/dma.h
> +++ b/arch/arm/plat-mxc/include/mach/dma.h
> @@ -60,8 +60,7 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
>  
>  static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
>  {
> -	return !strcmp(dev_name(chan->device->dev), "imx31-sdma") ||
> -		!strcmp(dev_name(chan->device->dev), "imx35-sdma") ||
> +	return strstr(dev_name(chan->device->dev), "sdma") ||
>  		!strcmp(dev_name(chan->device->dev), "imx-dma");
>  }
>  
> -- 
> 1.7.5.4
> 
> 
>

Patch

diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h
index 233d0a5..1b90803 100644
--- a/arch/arm/plat-mxc/include/mach/dma.h
+++ b/arch/arm/plat-mxc/include/mach/dma.h
@@ -60,8 +60,7 @@  static inline int imx_dma_is_ipu(struct dma_chan *chan)
 
 static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
 {
-	return !strcmp(dev_name(chan->device->dev), "imx31-sdma") ||
-		!strcmp(dev_name(chan->device->dev), "imx35-sdma") ||
+	return strstr(dev_name(chan->device->dev), "sdma") ||
 		!strcmp(dev_name(chan->device->dev), "imx-dma");
 }