diff options
Diffstat (limited to 'arch/ppc/syslib/cpm2_common.c')
-rw-r--r-- | arch/ppc/syslib/cpm2_common.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c index cbac44b1620c..6cd859d7721f 100644 --- a/arch/ppc/syslib/cpm2_common.c +++ b/arch/ppc/syslib/cpm2_common.c | |||
@@ -136,15 +136,14 @@ static void cpm2_dpinit(void) | |||
136 | * varies with the processor and the microcode patches activated. | 136 | * varies with the processor and the microcode patches activated. |
137 | * But the following should be at least safe. | 137 | * But the following should be at least safe. |
138 | */ | 138 | */ |
139 | rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, | 139 | rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE); |
140 | CPM_DATAONLY_SIZE); | ||
141 | } | 140 | } |
142 | 141 | ||
143 | /* This function returns an index into the DPRAM area. | 142 | /* This function returns an index into the DPRAM area. |
144 | */ | 143 | */ |
145 | uint cpm_dpalloc(uint size, uint align) | 144 | unsigned long cpm_dpalloc(uint size, uint align) |
146 | { | 145 | { |
147 | void *start; | 146 | unsigned long start; |
148 | unsigned long flags; | 147 | unsigned long flags; |
149 | 148 | ||
150 | spin_lock_irqsave(&cpm_dpmem_lock, flags); | 149 | spin_lock_irqsave(&cpm_dpmem_lock, flags); |
@@ -152,17 +151,17 @@ uint cpm_dpalloc(uint size, uint align) | |||
152 | start = rh_alloc(&cpm_dpmem_info, size, "commproc"); | 151 | start = rh_alloc(&cpm_dpmem_info, size, "commproc"); |
153 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); | 152 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); |
154 | 153 | ||
155 | return (uint)start; | 154 | return start; |
156 | } | 155 | } |
157 | EXPORT_SYMBOL(cpm_dpalloc); | 156 | EXPORT_SYMBOL(cpm_dpalloc); |
158 | 157 | ||
159 | int cpm_dpfree(uint offset) | 158 | int cpm_dpfree(unsigned long offset) |
160 | { | 159 | { |
161 | int ret; | 160 | int ret; |
162 | unsigned long flags; | 161 | unsigned long flags; |
163 | 162 | ||
164 | spin_lock_irqsave(&cpm_dpmem_lock, flags); | 163 | spin_lock_irqsave(&cpm_dpmem_lock, flags); |
165 | ret = rh_free(&cpm_dpmem_info, (void *)offset); | 164 | ret = rh_free(&cpm_dpmem_info, offset); |
166 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); | 165 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); |
167 | 166 | ||
168 | return ret; | 167 | return ret; |
@@ -170,17 +169,17 @@ int cpm_dpfree(uint offset) | |||
170 | EXPORT_SYMBOL(cpm_dpfree); | 169 | EXPORT_SYMBOL(cpm_dpfree); |
171 | 170 | ||
172 | /* not sure if this is ever needed */ | 171 | /* not sure if this is ever needed */ |
173 | uint cpm_dpalloc_fixed(uint offset, uint size, uint align) | 172 | unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align) |
174 | { | 173 | { |
175 | void *start; | 174 | unsigned long start; |
176 | unsigned long flags; | 175 | unsigned long flags; |
177 | 176 | ||
178 | spin_lock_irqsave(&cpm_dpmem_lock, flags); | 177 | spin_lock_irqsave(&cpm_dpmem_lock, flags); |
179 | cpm_dpmem_info.alignment = align; | 178 | cpm_dpmem_info.alignment = align; |
180 | start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc"); | 179 | start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc"); |
181 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); | 180 | spin_unlock_irqrestore(&cpm_dpmem_lock, flags); |
182 | 181 | ||
183 | return (uint)start; | 182 | return start; |
184 | } | 183 | } |
185 | EXPORT_SYMBOL(cpm_dpalloc_fixed); | 184 | EXPORT_SYMBOL(cpm_dpalloc_fixed); |
186 | 185 | ||
@@ -190,7 +189,7 @@ void cpm_dpdump(void) | |||
190 | } | 189 | } |
191 | EXPORT_SYMBOL(cpm_dpdump); | 190 | EXPORT_SYMBOL(cpm_dpdump); |
192 | 191 | ||
193 | void *cpm_dpram_addr(uint offset) | 192 | void *cpm_dpram_addr(unsigned long offset) |
194 | { | 193 | { |
195 | return (void *)&cpm2_immr->im_dprambase[offset]; | 194 | return (void *)&cpm2_immr->im_dprambase[offset]; |
196 | } | 195 | } |