Skip to content

Commit 1df8130

Browse files
Russell KingRussell King
authored andcommitted
[ARM] dma: remove dmach_t typedef
Remove a pointless integer typedef. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent f40b121 commit 1df8130

6 files changed

Lines changed: 98 additions & 100 deletions

File tree

‎arch/arm/include/asm/dma.h‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include <asm/system.h>
2020
#include <asm/scatterlist.h>
2121

22-
typedef unsigned int dmach_t;
23-
2422
#include <mach/isa-dma.h>
2523

2624
/*
@@ -52,70 +50,70 @@ static inline void release_dma_lock(unsigned long flags)
5250
/* Clear the 'DMA Pointer Flip Flop'.
5351
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
5452
*/
55-
#define clear_dma_ff(channel)
53+
#define clear_dma_ff(chan)
5654

5755
/* Set only the page register bits of the transfer address.
5856
*
5957
* NOTE: This is an architecture specific function, and should
6058
* be hidden from the drivers
6159
*/
62-
extern void set_dma_page(dmach_t channel, char pagenr);
60+
extern void set_dma_page(unsigned int chan, char pagenr);
6361

6462
/* Request a DMA channel
6563
*
6664
* Some architectures may need to do allocate an interrupt
6765
*/
68-
extern int request_dma(dmach_t channel, const char * device_id);
66+
extern int request_dma(unsigned int chan, const char * device_id);
6967

7068
/* Free a DMA channel
7169
*
7270
* Some architectures may need to do free an interrupt
7371
*/
74-
extern void free_dma(dmach_t channel);
72+
extern void free_dma(unsigned int chan);
7573

7674
/* Enable DMA for this channel
7775
*
7876
* On some architectures, this may have other side effects like
7977
* enabling an interrupt and setting the DMA registers.
8078
*/
81-
extern void enable_dma(dmach_t channel);
79+
extern void enable_dma(unsigned int chan);
8280

8381
/* Disable DMA for this channel
8482
*
8583
* On some architectures, this may have other side effects like
8684
* disabling an interrupt or whatever.
8785
*/
88-
extern void disable_dma(dmach_t channel);
86+
extern void disable_dma(unsigned int chan);
8987

9088
/* Test whether the specified channel has an active DMA transfer
9189
*/
92-
extern int dma_channel_active(dmach_t channel);
90+
extern int dma_channel_active(unsigned int chan);
9391

9492
/* Set the DMA scatter gather list for this channel
9593
*
9694
* This should not be called if a DMA channel is enabled,
9795
* especially since some DMA architectures don't update the
9896
* DMA address immediately, but defer it to the enable_dma().
9997
*/
100-
extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
98+
extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
10199

102100
/* Set the DMA address for this channel
103101
*
104102
* This should not be called if a DMA channel is enabled,
105103
* especially since some DMA architectures don't update the
106104
* DMA address immediately, but defer it to the enable_dma().
107105
*/
108-
extern void __set_dma_addr(dmach_t channel, void *addr);
109-
#define set_dma_addr(channel, addr) \
110-
__set_dma_addr(channel, bus_to_virt(addr))
106+
extern void __set_dma_addr(unsigned int chan, void *addr);
107+
#define set_dma_addr(chan, addr) \
108+
__set_dma_addr(chan, bus_to_virt(addr))
111109

112110
/* Set the DMA byte count for this channel
113111
*
114112
* This should not be called if a DMA channel is enabled,
115113
* especially since some DMA architectures don't update the
116114
* DMA count immediately, but defer it to the enable_dma().
117115
*/
118-
extern void set_dma_count(dmach_t channel, unsigned long count);
116+
extern void set_dma_count(unsigned int chan, unsigned long count);
119117

120118
/* Set the transfer direction for this channel
121119
*
@@ -124,19 +122,19 @@ extern void set_dma_count(dmach_t channel, unsigned long count);
124122
* DMA transfer direction immediately, but defer it to the
125123
* enable_dma().
126124
*/
127-
extern void set_dma_mode(dmach_t channel, dmamode_t mode);
125+
extern void set_dma_mode(unsigned int chan, dmamode_t mode);
128126

129127
/* Set the transfer speed for this channel
130128
*/
131-
extern void set_dma_speed(dmach_t channel, int cycle_ns);
129+
extern void set_dma_speed(unsigned int chan, int cycle_ns);
132130

133131
/* Get DMA residue count. After a DMA transfer, this
134132
* should return zero. Reading this while a DMA transfer is
135133
* still in progress will return unpredictable results.
136134
* If called before the channel has been used, it may return 1.
137135
* Otherwise, it returns the number of _bytes_ left to transfer.
138136
*/
139-
extern int get_dma_residue(dmach_t channel);
137+
extern int get_dma_residue(unsigned int chan);
140138

141139
#ifndef NO_DMA
142140
#define NO_DMA 255

‎arch/arm/include/asm/mach/dma.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ struct dma_struct;
1515
typedef struct dma_struct dma_t;
1616

1717
struct dma_ops {
18-
int (*request)(dmach_t, dma_t *); /* optional */
19-
void (*free)(dmach_t, dma_t *); /* optional */
20-
void (*enable)(dmach_t, dma_t *); /* mandatory */
21-
void (*disable)(dmach_t, dma_t *); /* mandatory */
22-
int (*residue)(dmach_t, dma_t *); /* optional */
23-
int (*setspeed)(dmach_t, dma_t *, int); /* optional */
18+
int (*request)(unsigned int, dma_t *); /* optional */
19+
void (*free)(unsigned int, dma_t *); /* optional */
20+
void (*enable)(unsigned int, dma_t *); /* mandatory */
21+
void (*disable)(unsigned int, dma_t *); /* mandatory */
22+
int (*residue)(unsigned int, dma_t *); /* optional */
23+
int (*setspeed)(unsigned int, dma_t *, int); /* optional */
2424
char *type;
2525
};
2626

‎arch/arm/kernel/dma-isa.c‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@ static unsigned int isa_dma_port[8][7] = {
4949
{ 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce }
5050
};
5151

52-
static int isa_get_dma_residue(dmach_t channel, dma_t *dma)
52+
static int isa_get_dma_residue(unsigned int chan, dma_t *dma)
5353
{
54-
unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT];
54+
unsigned int io_port = isa_dma_port[chan][ISA_DMA_COUNT];
5555
int count;
5656

5757
count = 1 + inb(io_port);
5858
count |= inb(io_port) << 8;
5959

60-
return channel < 4 ? count : (count << 1);
60+
return chan < 4 ? count : (count << 1);
6161
}
6262

63-
static void isa_enable_dma(dmach_t channel, dma_t *dma)
63+
static void isa_enable_dma(unsigned int chan, dma_t *dma)
6464
{
6565
if (dma->invalid) {
6666
unsigned long address, length;
6767
unsigned int mode;
6868
enum dma_data_direction direction;
6969

70-
mode = channel & 3;
70+
mode = chan & 3;
7171
switch (dma->dma_mode & DMA_MODE_MASK) {
7272
case DMA_MODE_READ:
7373
mode |= ISA_DMA_MODE_READ;
@@ -105,34 +105,34 @@ static void isa_enable_dma(dmach_t channel, dma_t *dma)
105105
address = dma->buf.dma_address;
106106
length = dma->buf.length - 1;
107107

108-
outb(address >> 16, isa_dma_port[channel][ISA_DMA_PGLO]);
109-
outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]);
108+
outb(address >> 16, isa_dma_port[chan][ISA_DMA_PGLO]);
109+
outb(address >> 24, isa_dma_port[chan][ISA_DMA_PGHI]);
110110

111-
if (channel >= 4) {
111+
if (chan >= 4) {
112112
address >>= 1;
113113
length >>= 1;
114114
}
115115

116-
outb(0, isa_dma_port[channel][ISA_DMA_CLRFF]);
116+
outb(0, isa_dma_port[chan][ISA_DMA_CLRFF]);
117117

118-
outb(address, isa_dma_port[channel][ISA_DMA_ADDR]);
119-
outb(address >> 8, isa_dma_port[channel][ISA_DMA_ADDR]);
118+
outb(address, isa_dma_port[chan][ISA_DMA_ADDR]);
119+
outb(address >> 8, isa_dma_port[chan][ISA_DMA_ADDR]);
120120

121-
outb(length, isa_dma_port[channel][ISA_DMA_COUNT]);
122-
outb(length >> 8, isa_dma_port[channel][ISA_DMA_COUNT]);
121+
outb(length, isa_dma_port[chan][ISA_DMA_COUNT]);
122+
outb(length >> 8, isa_dma_port[chan][ISA_DMA_COUNT]);
123123

124124
if (dma->dma_mode & DMA_AUTOINIT)
125125
mode |= ISA_DMA_AUTOINIT;
126126

127-
outb(mode, isa_dma_port[channel][ISA_DMA_MODE]);
127+
outb(mode, isa_dma_port[chan][ISA_DMA_MODE]);
128128
dma->invalid = 0;
129129
}
130-
outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]);
130+
outb(chan & 3, isa_dma_port[chan][ISA_DMA_MASK]);
131131
}
132132

133-
static void isa_disable_dma(dmach_t channel, dma_t *dma)
133+
static void isa_disable_dma(unsigned int chan, dma_t *dma)
134134
{
135-
outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]);
135+
outb(chan | 4, isa_dma_port[chan][ISA_DMA_MASK]);
136136
}
137137

138138
static struct dma_ops isa_dma_ops = {
@@ -178,11 +178,11 @@ void __init isa_init_dma(dma_t *dma)
178178
outb(0xaa, 0x00);
179179

180180
if (inb(0) == 0x55 && inb(0) == 0xaa) {
181-
int channel, i;
181+
int chan, i;
182182

183-
for (channel = 0; channel < 8; channel++) {
184-
dma[channel].d_ops = &isa_dma_ops;
185-
isa_disable_dma(channel, NULL);
183+
for (chan = 0; chan < 8; chan++) {
184+
dma[chan].d_ops = &isa_dma_ops;
185+
isa_disable_dma(chan, NULL);
186186
}
187187

188188
outb(0x40, 0x0b);

0 commit comments

Comments
 (0)