aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-08 09:53:35 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-04-03 19:31:43 -0400
commitad0c381a8b3a15b8edfca0996729ea45692470ca (patch)
tree0c693b5259fc2150182999a1aa06a807ecf04263 /arch/arm/mach-omap2
parente38b1485fde832f72ab478f947f6e78a8e28c58b (diff)
ARM: omap: remove almost-const variables
dma_stride and dma_common_ch_start are only ever initialised to one known value at initialisation, and are private to each of these files. There's no point these being variables at all. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/dma.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 81c2d3383bc5..e4ac7ac9a228 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -38,11 +38,10 @@
38#define OMAP2_DMA_STRIDE 0x60 38#define OMAP2_DMA_STRIDE 0x60
39 39
40static u32 errata; 40static u32 errata;
41static u8 dma_stride;
42 41
43static struct omap_dma_dev_attr *d; 42static struct omap_dma_dev_attr *d;
44 43
45static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end; 44static enum omap_reg_offsets dma_common_ch_end;
46 45
47static u16 reg_map[] = { 46static u16 reg_map[] = {
48 [REVISION] = 0x00, 47 [REVISION] = 0x00,
@@ -96,7 +95,7 @@ static inline void dma_write(u32 val, int reg, int lch)
96 u8 stride; 95 u8 stride;
97 u32 offset; 96 u32 offset;
98 97
99 stride = (reg >= dma_common_ch_start) ? dma_stride : 0; 98 stride = (reg >= CSDP) ? OMAP2_DMA_STRIDE : 0;
100 offset = reg_map[reg] + (stride * lch); 99 offset = reg_map[reg] + (stride * lch);
101 __raw_writel(val, dma_base + offset); 100 __raw_writel(val, dma_base + offset);
102} 101}
@@ -106,7 +105,7 @@ static inline u32 dma_read(int reg, int lch)
106 u8 stride; 105 u8 stride;
107 u32 offset, val; 106 u32 offset, val;
108 107
109 stride = (reg >= dma_common_ch_start) ? dma_stride : 0; 108 stride = (reg >= CSDP) ? OMAP2_DMA_STRIDE : 0;
110 offset = reg_map[reg] + (stride * lch); 109 offset = reg_map[reg] + (stride * lch);
111 val = __raw_readl(dma_base + offset); 110 val = __raw_readl(dma_base + offset);
112 return val; 111 return val;
@@ -114,9 +113,9 @@ static inline u32 dma_read(int reg, int lch)
114 113
115static void omap2_clear_dma(int lch) 114static void omap2_clear_dma(int lch)
116{ 115{
117 int i = dma_common_ch_start; 116 int i;
118 117
119 for (; i <= dma_common_ch_end; i += 1) 118 for (i = CSDP; i <= dma_common_ch_end; i += 1)
120 dma_write(0, i, lch); 119 dma_write(0, i, lch);
121} 120}
122 121
@@ -219,9 +218,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
219 struct resource *mem; 218 struct resource *mem;
220 char *name = "omap_dma_system"; 219 char *name = "omap_dma_system";
221 220
222 dma_stride = OMAP2_DMA_STRIDE;
223 dma_common_ch_start = CSDP;
224
225 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL); 221 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
226 if (!p) { 222 if (!p) {
227 pr_err("%s: Unable to allocate pdata for %s:%s\n", 223 pr_err("%s: Unable to allocate pdata for %s:%s\n",