diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-12-08 10:58:50 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-08 10:58:50 -0500 |
commit | 1df8130278c4543555fea697e5714fbac300b899 (patch) | |
tree | cf9ed1b4b76fcdaa9d61ff3dea2e9cbd6396a9e1 /arch/arm/kernel/dma.c | |
parent | f40b121d983dfc53bde882aadec7f2f0bbcbd1c2 (diff) |
[ARM] dma: remove dmach_t typedef
Remove a pointless integer typedef.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/dma.c')
-rw-r--r-- | arch/arm/kernel/dma.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c index d006085ed7e7..c31bf00e5bae 100644 --- a/arch/arm/kernel/dma.c +++ b/arch/arm/kernel/dma.c | |||
@@ -30,12 +30,12 @@ static dma_t dma_chan[MAX_DMA_CHANNELS]; | |||
30 | * | 30 | * |
31 | * On certain platforms, we have to allocate an interrupt as well... | 31 | * On certain platforms, we have to allocate an interrupt as well... |
32 | */ | 32 | */ |
33 | int request_dma(dmach_t channel, const char *device_id) | 33 | int request_dma(unsigned int chan, const char *device_id) |
34 | { | 34 | { |
35 | dma_t *dma = dma_chan + channel; | 35 | dma_t *dma = dma_chan + chan; |
36 | int ret; | 36 | int ret; |
37 | 37 | ||
38 | if (channel >= MAX_DMA_CHANNELS || !dma->d_ops) | 38 | if (chan >= MAX_DMA_CHANNELS || !dma->d_ops) |
39 | goto bad_dma; | 39 | goto bad_dma; |
40 | 40 | ||
41 | if (xchg(&dma->lock, 1) != 0) | 41 | if (xchg(&dma->lock, 1) != 0) |
@@ -47,7 +47,7 @@ int request_dma(dmach_t channel, const char *device_id) | |||
47 | 47 | ||
48 | ret = 0; | 48 | ret = 0; |
49 | if (dma->d_ops->request) | 49 | if (dma->d_ops->request) |
50 | ret = dma->d_ops->request(channel, dma); | 50 | ret = dma->d_ops->request(chan, dma); |
51 | 51 | ||
52 | if (ret) | 52 | if (ret) |
53 | xchg(&dma->lock, 0); | 53 | xchg(&dma->lock, 0); |
@@ -55,7 +55,7 @@ int request_dma(dmach_t channel, const char *device_id) | |||
55 | return ret; | 55 | return ret; |
56 | 56 | ||
57 | bad_dma: | 57 | bad_dma: |
58 | printk(KERN_ERR "dma: trying to allocate DMA%d\n", channel); | 58 | printk(KERN_ERR "dma: trying to allocate DMA%d\n", chan); |
59 | return -EINVAL; | 59 | return -EINVAL; |
60 | 60 | ||
61 | busy: | 61 | busy: |
@@ -68,42 +68,42 @@ EXPORT_SYMBOL(request_dma); | |||
68 | * | 68 | * |
69 | * On certain platforms, we have to free interrupt as well... | 69 | * On certain platforms, we have to free interrupt as well... |
70 | */ | 70 | */ |
71 | void free_dma(dmach_t channel) | 71 | void free_dma(unsigned int chan) |
72 | { | 72 | { |
73 | dma_t *dma = dma_chan + channel; | 73 | dma_t *dma = dma_chan + chan; |
74 | 74 | ||
75 | if (channel >= MAX_DMA_CHANNELS || !dma->d_ops) | 75 | if (chan >= MAX_DMA_CHANNELS || !dma->d_ops) |
76 | goto bad_dma; | 76 | goto bad_dma; |
77 | 77 | ||
78 | if (dma->active) { | 78 | if (dma->active) { |
79 | printk(KERN_ERR "dma%d: freeing active DMA\n", channel); | 79 | printk(KERN_ERR "dma%d: freeing active DMA\n", chan); |
80 | dma->d_ops->disable(channel, dma); | 80 | dma->d_ops->disable(chan, dma); |
81 | dma->active = 0; | 81 | dma->active = 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | if (xchg(&dma->lock, 0) != 0) { | 84 | if (xchg(&dma->lock, 0) != 0) { |
85 | if (dma->d_ops->free) | 85 | if (dma->d_ops->free) |
86 | dma->d_ops->free(channel, dma); | 86 | dma->d_ops->free(chan, dma); |
87 | return; | 87 | return; |
88 | } | 88 | } |
89 | 89 | ||
90 | printk(KERN_ERR "dma%d: trying to free free DMA\n", channel); | 90 | printk(KERN_ERR "dma%d: trying to free free DMA\n", chan); |
91 | return; | 91 | return; |
92 | 92 | ||
93 | bad_dma: | 93 | bad_dma: |
94 | printk(KERN_ERR "dma: trying to free DMA%d\n", channel); | 94 | printk(KERN_ERR "dma: trying to free DMA%d\n", chan); |
95 | } | 95 | } |
96 | EXPORT_SYMBOL(free_dma); | 96 | EXPORT_SYMBOL(free_dma); |
97 | 97 | ||
98 | /* Set DMA Scatter-Gather list | 98 | /* Set DMA Scatter-Gather list |
99 | */ | 99 | */ |
100 | void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg) | 100 | void set_dma_sg (unsigned int chan, struct scatterlist *sg, int nr_sg) |
101 | { | 101 | { |
102 | dma_t *dma = dma_chan + channel; | 102 | dma_t *dma = dma_chan + chan; |
103 | 103 | ||
104 | if (dma->active) | 104 | if (dma->active) |
105 | printk(KERN_ERR "dma%d: altering DMA SG while " | 105 | printk(KERN_ERR "dma%d: altering DMA SG while " |
106 | "DMA active\n", channel); | 106 | "DMA active\n", chan); |
107 | 107 | ||
108 | dma->sg = sg; | 108 | dma->sg = sg; |
109 | dma->sgcount = nr_sg; | 109 | dma->sgcount = nr_sg; |
@@ -115,13 +115,13 @@ EXPORT_SYMBOL(set_dma_sg); | |||
115 | * | 115 | * |
116 | * Copy address to the structure, and set the invalid bit | 116 | * Copy address to the structure, and set the invalid bit |
117 | */ | 117 | */ |
118 | void __set_dma_addr (dmach_t channel, void *addr) | 118 | void __set_dma_addr (unsigned int chan, void *addr) |
119 | { | 119 | { |
120 | dma_t *dma = dma_chan + channel; | 120 | dma_t *dma = dma_chan + chan; |
121 | 121 | ||
122 | if (dma->active) | 122 | if (dma->active) |
123 | printk(KERN_ERR "dma%d: altering DMA address while " | 123 | printk(KERN_ERR "dma%d: altering DMA address while " |
124 | "DMA active\n", channel); | 124 | "DMA active\n", chan); |
125 | 125 | ||
126 | dma->sg = NULL; | 126 | dma->sg = NULL; |
127 | dma->addr = addr; | 127 | dma->addr = addr; |
@@ -133,13 +133,13 @@ EXPORT_SYMBOL(__set_dma_addr); | |||
133 | * | 133 | * |
134 | * Copy address to the structure, and set the invalid bit | 134 | * Copy address to the structure, and set the invalid bit |
135 | */ | 135 | */ |
136 | void set_dma_count (dmach_t channel, unsigned long count) | 136 | void set_dma_count (unsigned int chan, unsigned long count) |
137 | { | 137 | { |
138 | dma_t *dma = dma_chan + channel; | 138 | dma_t *dma = dma_chan + chan; |
139 | 139 | ||
140 | if (dma->active) | 140 | if (dma->active) |
141 | printk(KERN_ERR "dma%d: altering DMA count while " | 141 | printk(KERN_ERR "dma%d: altering DMA count while " |
142 | "DMA active\n", channel); | 142 | "DMA active\n", chan); |
143 | 143 | ||
144 | dma->sg = NULL; | 144 | dma->sg = NULL; |
145 | dma->count = count; | 145 | dma->count = count; |
@@ -149,13 +149,13 @@ EXPORT_SYMBOL(set_dma_count); | |||
149 | 149 | ||
150 | /* Set DMA direction mode | 150 | /* Set DMA direction mode |
151 | */ | 151 | */ |
152 | void set_dma_mode (dmach_t channel, dmamode_t mode) | 152 | void set_dma_mode (unsigned int chan, dmamode_t mode) |
153 | { | 153 | { |
154 | dma_t *dma = dma_chan + channel; | 154 | dma_t *dma = dma_chan + chan; |
155 | 155 | ||
156 | if (dma->active) | 156 | if (dma->active) |
157 | printk(KERN_ERR "dma%d: altering DMA mode while " | 157 | printk(KERN_ERR "dma%d: altering DMA mode while " |
158 | "DMA active\n", channel); | 158 | "DMA active\n", chan); |
159 | 159 | ||
160 | dma->dma_mode = mode; | 160 | dma->dma_mode = mode; |
161 | dma->invalid = 1; | 161 | dma->invalid = 1; |
@@ -164,42 +164,42 @@ EXPORT_SYMBOL(set_dma_mode); | |||
164 | 164 | ||
165 | /* Enable DMA channel | 165 | /* Enable DMA channel |
166 | */ | 166 | */ |
167 | void enable_dma (dmach_t channel) | 167 | void enable_dma (unsigned int chan) |
168 | { | 168 | { |
169 | dma_t *dma = dma_chan + channel; | 169 | dma_t *dma = dma_chan + chan; |
170 | 170 | ||
171 | if (!dma->lock) | 171 | if (!dma->lock) |
172 | goto free_dma; | 172 | goto free_dma; |
173 | 173 | ||
174 | if (dma->active == 0) { | 174 | if (dma->active == 0) { |
175 | dma->active = 1; | 175 | dma->active = 1; |
176 | dma->d_ops->enable(channel, dma); | 176 | dma->d_ops->enable(chan, dma); |
177 | } | 177 | } |
178 | return; | 178 | return; |
179 | 179 | ||
180 | free_dma: | 180 | free_dma: |
181 | printk(KERN_ERR "dma%d: trying to enable free DMA\n", channel); | 181 | printk(KERN_ERR "dma%d: trying to enable free DMA\n", chan); |
182 | BUG(); | 182 | BUG(); |
183 | } | 183 | } |
184 | EXPORT_SYMBOL(enable_dma); | 184 | EXPORT_SYMBOL(enable_dma); |
185 | 185 | ||
186 | /* Disable DMA channel | 186 | /* Disable DMA channel |
187 | */ | 187 | */ |
188 | void disable_dma (dmach_t channel) | 188 | void disable_dma (unsigned int chan) |
189 | { | 189 | { |
190 | dma_t *dma = dma_chan + channel; | 190 | dma_t *dma = dma_chan + chan; |
191 | 191 | ||
192 | if (!dma->lock) | 192 | if (!dma->lock) |
193 | goto free_dma; | 193 | goto free_dma; |
194 | 194 | ||
195 | if (dma->active == 1) { | 195 | if (dma->active == 1) { |
196 | dma->active = 0; | 196 | dma->active = 0; |
197 | dma->d_ops->disable(channel, dma); | 197 | dma->d_ops->disable(chan, dma); |
198 | } | 198 | } |
199 | return; | 199 | return; |
200 | 200 | ||
201 | free_dma: | 201 | free_dma: |
202 | printk(KERN_ERR "dma%d: trying to disable free DMA\n", channel); | 202 | printk(KERN_ERR "dma%d: trying to disable free DMA\n", chan); |
203 | BUG(); | 203 | BUG(); |
204 | } | 204 | } |
205 | EXPORT_SYMBOL(disable_dma); | 205 | EXPORT_SYMBOL(disable_dma); |
@@ -207,36 +207,36 @@ EXPORT_SYMBOL(disable_dma); | |||
207 | /* | 207 | /* |
208 | * Is the specified DMA channel active? | 208 | * Is the specified DMA channel active? |
209 | */ | 209 | */ |
210 | int dma_channel_active(dmach_t channel) | 210 | int dma_channel_active(unsigned int chan) |
211 | { | 211 | { |
212 | return dma_chan[channel].active; | 212 | return dma_chan[chan].active; |
213 | } | 213 | } |
214 | EXPORT_SYMBOL(dma_channel_active); | 214 | EXPORT_SYMBOL(dma_channel_active); |
215 | 215 | ||
216 | void set_dma_page(dmach_t channel, char pagenr) | 216 | void set_dma_page(unsigned int chan, char pagenr) |
217 | { | 217 | { |
218 | printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel); | 218 | printk(KERN_ERR "dma%d: trying to set_dma_page\n", chan); |
219 | } | 219 | } |
220 | EXPORT_SYMBOL(set_dma_page); | 220 | EXPORT_SYMBOL(set_dma_page); |
221 | 221 | ||
222 | void set_dma_speed(dmach_t channel, int cycle_ns) | 222 | void set_dma_speed(unsigned int chan, int cycle_ns) |
223 | { | 223 | { |
224 | dma_t *dma = dma_chan + channel; | 224 | dma_t *dma = dma_chan + chan; |
225 | int ret = 0; | 225 | int ret = 0; |
226 | 226 | ||
227 | if (dma->d_ops->setspeed) | 227 | if (dma->d_ops->setspeed) |
228 | ret = dma->d_ops->setspeed(channel, dma, cycle_ns); | 228 | ret = dma->d_ops->setspeed(chan, dma, cycle_ns); |
229 | dma->speed = ret; | 229 | dma->speed = ret; |
230 | } | 230 | } |
231 | EXPORT_SYMBOL(set_dma_speed); | 231 | EXPORT_SYMBOL(set_dma_speed); |
232 | 232 | ||
233 | int get_dma_residue(dmach_t channel) | 233 | int get_dma_residue(unsigned int chan) |
234 | { | 234 | { |
235 | dma_t *dma = dma_chan + channel; | 235 | dma_t *dma = dma_chan + chan; |
236 | int ret = 0; | 236 | int ret = 0; |
237 | 237 | ||
238 | if (dma->d_ops->residue) | 238 | if (dma->d_ops->residue) |
239 | ret = dma->d_ops->residue(channel, dma); | 239 | ret = dma->d_ops->residue(chan, dma); |
240 | 240 | ||
241 | return ret; | 241 | return ret; |
242 | } | 242 | } |