dmaengine: shdma: Common SH_DMA_SLAVE_NUMBER
PATCH 2/5 dmaengine: shdma: Common SH_DMA_SLAVE_NUMBER
From: Magnus Damm <[email protected]>
Move SHDMA_SLAVE_NUMBER from asm/dmaengine.h to shdma.h. Set it to 256 to support a wide range of processors. The amount of memory consumed by this change is limited to 256 bits.
While at it, rename to SH_DMA_SLAVE_NUMBER to match with the rest of the file.
---
arch/sh/include/asm/dmaengine.h | 1 - drivers/dma/shdma.c | 4 ++-- drivers/dma/shdma.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-)
arch/sh/include/asm/dmaengine.h +0 -1
@@ -34,7 +34,6 @@ enum {SHDMA_SLAVE_SIUA_RX ,SHDMA_SLAVE_SIUB_TX , SHDMA_SLAVE_SIUB_RX, - SHDMA_SLAVE_NUMBER, /* Must stay last */ }; struct sh_dmae_slave_config {
drivers/dma/shdma.c +2 -2
@@ -44,7 +44,7 @@ enum sh_dmae_desc_status {#define LOG2_DEFAULT_XFER_SIZE 2/* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ -static unsigned long sh_dmae_slave_used[BITS_TO_LONGS (SHDMA_SLAVE_NUMBER )]; +static unsigned long sh_dmae_slave_used[BITS_TO_LONGS (SH_DMA_SLAVE_NUMBER )];static void sh_dmae_chan_ld_cleanup (struct sh_dmae_chan *sh_chan,bool all);
@@ -274,7 +274,7 @@ static struct sh_dmae_slave_config *sh_dstruct sh_dmae_pdata *pdata = shdev->pdata;int i; -if (param->slave_id >=SHDMA_SLAVE_NUMBER ) +if (param->slave_id >=SH_DMA_SLAVE_NUMBER )return NULL ;for (i =0 ; i < pdata->slave_num; i++)
drivers/dma/shdma.h +1 -0
@@ -19,6 +19,7 @@#include <asm/dmaengine.h> +#define SH_DMA_SLAVE_NUMBER 256#define SH_DMA_TCR_MAX 0x00FFFFFF/* 16MB */ struct device ;
Quoted 11 lines · Magnus Damm
From: Magnus Damm <[email protected]>
Move
SHDMA_SLAVE_NUMBERfromasm/dmaengine.htoshdma.h. Set it to 256 to support a wide range of processors. The amount of memory consumed by this change is limited to 256 bits.While at it, rename to
SH_DMA_SLAVE_NUMBERto match with the rest of the file.Signed-off-by Magnus Damm <[email protected]>
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/