diff options
author | Sangwook Lee <sangwook.lee@linaro.org> | 2011-07-16 02:50:19 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-07-16 02:50:19 -0400 |
commit | d670ac019f60e4932ba329bb0800bf2929e6d77c (patch) | |
tree | 43bdce92d0c6c6a34aea44cc764051cecb705fd2 | |
parent | 691abd0abf8fd496c96fdb5b4fb64721f02aa513 (diff) |
ARM: SAMSUNG: DMA Cleanup as per sparse
Function declaration differs between file: dma.c and file:dma.h
and SPARSE (Documentation/sparse.txt) gives error messages
All dma channels are members of 'enum dma_ch' and not 'unsigned int'
Please have a look at channel definitions in:
arch/arm/mach-s3c64xx/include/mach/dma.h
arch/arm/plat-samsung/include/plat/s3c-dma-pl330.h
arch/arm/mach-s3c2410/include/mach/dma.h
So all arguments should be of type 'enum dma_ch'
Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-s3c64xx/dma.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/dma.c | 12 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dma.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/dma.h | 21 |
4 files changed, 27 insertions, 26 deletions
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c index b197171e7d03..204bfafe4bfc 100644 --- a/arch/arm/mach-s3c64xx/dma.c +++ b/arch/arm/mach-s3c64xx/dma.c | |||
@@ -113,7 +113,7 @@ found: | |||
113 | return chan; | 113 | return chan; |
114 | } | 114 | } |
115 | 115 | ||
116 | int s3c2410_dma_config(unsigned int channel, int xferunit) | 116 | int s3c2410_dma_config(enum dma_ch channel, int xferunit) |
117 | { | 117 | { |
118 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 118 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
119 | 119 | ||
@@ -297,7 +297,7 @@ static int s3c64xx_dma_flush(struct s3c2410_dma_chan *chan) | |||
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) | 300 | int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op) |
301 | { | 301 | { |
302 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 302 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
303 | 303 | ||
@@ -331,7 +331,7 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl); | |||
331 | * | 331 | * |
332 | */ | 332 | */ |
333 | 333 | ||
334 | int s3c2410_dma_enqueue(unsigned int channel, void *id, | 334 | int s3c2410_dma_enqueue(enum dma_ch channel, void *id, |
335 | dma_addr_t data, int size) | 335 | dma_addr_t data, int size) |
336 | { | 336 | { |
337 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 337 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
@@ -415,7 +415,7 @@ err_buff: | |||
415 | EXPORT_SYMBOL(s3c2410_dma_enqueue); | 415 | EXPORT_SYMBOL(s3c2410_dma_enqueue); |
416 | 416 | ||
417 | 417 | ||
418 | int s3c2410_dma_devconfig(unsigned int channel, | 418 | int s3c2410_dma_devconfig(enum dma_ch channel, |
419 | enum s3c2410_dmasrc source, | 419 | enum s3c2410_dmasrc source, |
420 | unsigned long devaddr) | 420 | unsigned long devaddr) |
421 | { | 421 | { |
@@ -463,7 +463,7 @@ int s3c2410_dma_devconfig(unsigned int channel, | |||
463 | EXPORT_SYMBOL(s3c2410_dma_devconfig); | 463 | EXPORT_SYMBOL(s3c2410_dma_devconfig); |
464 | 464 | ||
465 | 465 | ||
466 | int s3c2410_dma_getposition(unsigned int channel, | 466 | int s3c2410_dma_getposition(enum dma_ch channel, |
467 | dma_addr_t *src, dma_addr_t *dst) | 467 | dma_addr_t *src, dma_addr_t *dst) |
468 | { | 468 | { |
469 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 469 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
@@ -487,7 +487,7 @@ EXPORT_SYMBOL(s3c2410_dma_getposition); | |||
487 | * get control of an dma channel | 487 | * get control of an dma channel |
488 | */ | 488 | */ |
489 | 489 | ||
490 | int s3c2410_dma_request(unsigned int channel, | 490 | int s3c2410_dma_request(enum dma_ch channel, |
491 | struct s3c2410_dma_client *client, | 491 | struct s3c2410_dma_client *client, |
492 | void *dev) | 492 | void *dev) |
493 | { | 493 | { |
@@ -533,7 +533,7 @@ EXPORT_SYMBOL(s3c2410_dma_request); | |||
533 | * allowed to go through. | 533 | * allowed to go through. |
534 | */ | 534 | */ |
535 | 535 | ||
536 | int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) | 536 | int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client) |
537 | { | 537 | { |
538 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 538 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
539 | unsigned long flags; | 539 | unsigned long flags; |
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index a79a8ccd25f6..539bd0e3defd 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c | |||
@@ -712,7 +712,7 @@ static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel); | |||
712 | * get control of an dma channel | 712 | * get control of an dma channel |
713 | */ | 713 | */ |
714 | 714 | ||
715 | int s3c2410_dma_request(unsigned int channel, | 715 | int s3c2410_dma_request(enum dma_ch channel, |
716 | struct s3c2410_dma_client *client, | 716 | struct s3c2410_dma_client *client, |
717 | void *dev) | 717 | void *dev) |
718 | { | 718 | { |
@@ -783,7 +783,7 @@ EXPORT_SYMBOL(s3c2410_dma_request); | |||
783 | * allowed to go through. | 783 | * allowed to go through. |
784 | */ | 784 | */ |
785 | 785 | ||
786 | int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) | 786 | int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client) |
787 | { | 787 | { |
788 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 788 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
789 | unsigned long flags; | 789 | unsigned long flags; |
@@ -974,7 +974,7 @@ static int s3c2410_dma_started(struct s3c2410_dma_chan *chan) | |||
974 | } | 974 | } |
975 | 975 | ||
976 | int | 976 | int |
977 | s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) | 977 | s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op) |
978 | { | 978 | { |
979 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 979 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
980 | 980 | ||
@@ -1021,7 +1021,7 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl); | |||
1021 | * xfersize: size of unit in bytes (1,2,4) | 1021 | * xfersize: size of unit in bytes (1,2,4) |
1022 | */ | 1022 | */ |
1023 | 1023 | ||
1024 | int s3c2410_dma_config(unsigned int channel, | 1024 | int s3c2410_dma_config(enum dma_ch channel, |
1025 | int xferunit) | 1025 | int xferunit) |
1026 | { | 1026 | { |
1027 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 1027 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
@@ -1100,7 +1100,7 @@ EXPORT_SYMBOL(s3c2410_dma_config); | |||
1100 | * devaddr: physical address of the source | 1100 | * devaddr: physical address of the source |
1101 | */ | 1101 | */ |
1102 | 1102 | ||
1103 | int s3c2410_dma_devconfig(unsigned int channel, | 1103 | int s3c2410_dma_devconfig(enum dma_ch channel, |
1104 | enum s3c2410_dmasrc source, | 1104 | enum s3c2410_dmasrc source, |
1105 | unsigned long devaddr) | 1105 | unsigned long devaddr) |
1106 | { | 1106 | { |
@@ -1173,7 +1173,7 @@ EXPORT_SYMBOL(s3c2410_dma_devconfig); | |||
1173 | * returns the current transfer points for the dma source and destination | 1173 | * returns the current transfer points for the dma source and destination |
1174 | */ | 1174 | */ |
1175 | 1175 | ||
1176 | int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst) | 1176 | int s3c2410_dma_getposition(enum dma_ch channel, dma_addr_t *src, dma_addr_t *dst) |
1177 | { | 1177 | { |
1178 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 1178 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
1179 | 1179 | ||
diff --git a/arch/arm/plat-samsung/dma.c b/arch/arm/plat-samsung/dma.c index cb459dd95459..6143aa147688 100644 --- a/arch/arm/plat-samsung/dma.c +++ b/arch/arm/plat-samsung/dma.c | |||
@@ -41,7 +41,7 @@ struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel) | |||
41 | * irq? | 41 | * irq? |
42 | */ | 42 | */ |
43 | 43 | ||
44 | int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) | 44 | int s3c2410_dma_set_opfn(enum dma_ch channel, s3c2410_dma_opfn_t rtn) |
45 | { | 45 | { |
46 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 46 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
47 | 47 | ||
@@ -56,7 +56,7 @@ int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) | |||
56 | } | 56 | } |
57 | EXPORT_SYMBOL(s3c2410_dma_set_opfn); | 57 | EXPORT_SYMBOL(s3c2410_dma_set_opfn); |
58 | 58 | ||
59 | int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) | 59 | int s3c2410_dma_set_buffdone_fn(enum dma_ch channel, s3c2410_dma_cbfn_t rtn) |
60 | { | 60 | { |
61 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 61 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
62 | 62 | ||
@@ -71,7 +71,7 @@ int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) | |||
71 | } | 71 | } |
72 | EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); | 72 | EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); |
73 | 73 | ||
74 | int s3c2410_dma_setflags(unsigned int channel, unsigned int flags) | 74 | int s3c2410_dma_setflags(enum dma_ch channel, unsigned int flags) |
75 | { | 75 | { |
76 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 76 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
77 | 77 | ||
diff --git a/arch/arm/plat-samsung/include/plat/dma.h b/arch/arm/plat-samsung/include/plat/dma.h index 2e8f8c6560d7..8c273b7a6f56 100644 --- a/arch/arm/plat-samsung/include/plat/dma.h +++ b/arch/arm/plat-samsung/include/plat/dma.h | |||
@@ -42,6 +42,7 @@ struct s3c2410_dma_client { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct s3c2410_dma_chan; | 44 | struct s3c2410_dma_chan; |
45 | enum dma_ch; | ||
45 | 46 | ||
46 | /* s3c2410_dma_cbfn_t | 47 | /* s3c2410_dma_cbfn_t |
47 | * | 48 | * |
@@ -62,7 +63,7 @@ typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, | |||
62 | * request a dma channel exclusivley | 63 | * request a dma channel exclusivley |
63 | */ | 64 | */ |
64 | 65 | ||
65 | extern int s3c2410_dma_request(unsigned int channel, | 66 | extern int s3c2410_dma_request(enum dma_ch channel, |
66 | struct s3c2410_dma_client *, void *dev); | 67 | struct s3c2410_dma_client *, void *dev); |
67 | 68 | ||
68 | 69 | ||
@@ -71,14 +72,14 @@ extern int s3c2410_dma_request(unsigned int channel, | |||
71 | * change the state of the dma channel | 72 | * change the state of the dma channel |
72 | */ | 73 | */ |
73 | 74 | ||
74 | extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); | 75 | extern int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op); |
75 | 76 | ||
76 | /* s3c2410_dma_setflags | 77 | /* s3c2410_dma_setflags |
77 | * | 78 | * |
78 | * set the channel's flags to a given state | 79 | * set the channel's flags to a given state |
79 | */ | 80 | */ |
80 | 81 | ||
81 | extern int s3c2410_dma_setflags(unsigned int channel, | 82 | extern int s3c2410_dma_setflags(enum dma_ch channel, |
82 | unsigned int flags); | 83 | unsigned int flags); |
83 | 84 | ||
84 | /* s3c2410_dma_free | 85 | /* s3c2410_dma_free |
@@ -86,7 +87,7 @@ extern int s3c2410_dma_setflags(unsigned int channel, | |||
86 | * free the dma channel (will also abort any outstanding operations) | 87 | * free the dma channel (will also abort any outstanding operations) |
87 | */ | 88 | */ |
88 | 89 | ||
89 | extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); | 90 | extern int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *); |
90 | 91 | ||
91 | /* s3c2410_dma_enqueue | 92 | /* s3c2410_dma_enqueue |
92 | * | 93 | * |
@@ -95,7 +96,7 @@ extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); | |||
95 | * drained before the buffer is given to the DMA system. | 96 | * drained before the buffer is given to the DMA system. |
96 | */ | 97 | */ |
97 | 98 | ||
98 | extern int s3c2410_dma_enqueue(unsigned int channel, void *id, | 99 | extern int s3c2410_dma_enqueue(enum dma_ch channel, void *id, |
99 | dma_addr_t data, int size); | 100 | dma_addr_t data, int size); |
100 | 101 | ||
101 | /* s3c2410_dma_config | 102 | /* s3c2410_dma_config |
@@ -103,14 +104,14 @@ extern int s3c2410_dma_enqueue(unsigned int channel, void *id, | |||
103 | * configure the dma channel | 104 | * configure the dma channel |
104 | */ | 105 | */ |
105 | 106 | ||
106 | extern int s3c2410_dma_config(unsigned int channel, int xferunit); | 107 | extern int s3c2410_dma_config(enum dma_ch channel, int xferunit); |
107 | 108 | ||
108 | /* s3c2410_dma_devconfig | 109 | /* s3c2410_dma_devconfig |
109 | * | 110 | * |
110 | * configure the device we're talking to | 111 | * configure the device we're talking to |
111 | */ | 112 | */ |
112 | 113 | ||
113 | extern int s3c2410_dma_devconfig(unsigned int channel, | 114 | extern int s3c2410_dma_devconfig(enum dma_ch channel, |
114 | enum s3c2410_dmasrc source, unsigned long devaddr); | 115 | enum s3c2410_dmasrc source, unsigned long devaddr); |
115 | 116 | ||
116 | /* s3c2410_dma_getposition | 117 | /* s3c2410_dma_getposition |
@@ -118,10 +119,10 @@ extern int s3c2410_dma_devconfig(unsigned int channel, | |||
118 | * get the position that the dma transfer is currently at | 119 | * get the position that the dma transfer is currently at |
119 | */ | 120 | */ |
120 | 121 | ||
121 | extern int s3c2410_dma_getposition(unsigned int channel, | 122 | extern int s3c2410_dma_getposition(enum dma_ch channel, |
122 | dma_addr_t *src, dma_addr_t *dest); | 123 | dma_addr_t *src, dma_addr_t *dest); |
123 | 124 | ||
124 | extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); | 125 | extern int s3c2410_dma_set_opfn(enum dma_ch, s3c2410_dma_opfn_t rtn); |
125 | extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); | 126 | extern int s3c2410_dma_set_buffdone_fn(enum dma_ch, s3c2410_dma_cbfn_t rtn); |
126 | 127 | ||
127 | 128 | ||