aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-armada-370-xp.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-04-09 17:26:16 -0400
committerJason Cooper <jason@lakedaemon.net>2013-04-15 15:34:50 -0400
commitb313ada8c7a45e37e270bcaafef3f455fa9f4abf (patch)
tree7feb97c75a7f8474f30cef76be430e6b41353cc7 /drivers/irqchip/irq-armada-370-xp.c
parent9339d432fdf4b492d2209316791b6e54cdae0242 (diff)
irqchip: armada-370-xp: move IRQ handler to avoid forward declaration
If we move the IRQ handler function above the initialization function, we avoid a forward declaration. This wasn't done as part of the previous commit, in order to increase the readibility of the previous commit, who was also moving the IRQ controller driver from arch/arm to drivers/irqchip. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/irqchip/irq-armada-370-xp.c')
-rw-r--r--drivers/irqchip/irq-armada-370-xp.c83
1 files changed, 40 insertions, 43 deletions
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index d20a832ba86b..1115bf878ca0 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -206,49 +206,6 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
206}; 206};
207 207
208static asmlinkage void __exception_irq_entry 208static asmlinkage void __exception_irq_entry
209armada_370_xp_handle_irq(struct pt_regs *regs);
210
211static int __init armada_370_xp_mpic_of_init(struct device_node *node,
212 struct device_node *parent)
213{
214 u32 control;
215
216 main_int_base = of_iomap(node, 0);
217 per_cpu_int_base = of_iomap(node, 1);
218
219 BUG_ON(!main_int_base);
220 BUG_ON(!per_cpu_int_base);
221
222 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
223
224 armada_370_xp_mpic_domain =
225 irq_domain_add_linear(node, (control >> 2) & 0x3ff,
226 &armada_370_xp_mpic_irq_ops, NULL);
227
228 if (!armada_370_xp_mpic_domain)
229 panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
230
231 irq_set_default_host(armada_370_xp_mpic_domain);
232
233#ifdef CONFIG_SMP
234 armada_xp_mpic_smp_cpu_init();
235
236 /*
237 * Set the default affinity from all CPUs to the boot cpu.
238 * This is required since the MPIC doesn't limit several CPUs
239 * from acknowledging the same interrupt.
240 */
241 cpumask_clear(irq_default_affinity);
242 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
243
244#endif
245
246 set_handle_irq(armada_370_xp_handle_irq);
247
248 return 0;
249}
250
251static asmlinkage void __exception_irq_entry
252armada_370_xp_handle_irq(struct pt_regs *regs) 209armada_370_xp_handle_irq(struct pt_regs *regs)
253{ 210{
254 u32 irqstat, irqnr; 211 u32 irqstat, irqnr;
@@ -291,4 +248,44 @@ armada_370_xp_handle_irq(struct pt_regs *regs)
291 } while (1); 248 } while (1);
292} 249}
293 250
251static int __init armada_370_xp_mpic_of_init(struct device_node *node,
252 struct device_node *parent)
253{
254 u32 control;
255
256 main_int_base = of_iomap(node, 0);
257 per_cpu_int_base = of_iomap(node, 1);
258
259 BUG_ON(!main_int_base);
260 BUG_ON(!per_cpu_int_base);
261
262 control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
263
264 armada_370_xp_mpic_domain =
265 irq_domain_add_linear(node, (control >> 2) & 0x3ff,
266 &armada_370_xp_mpic_irq_ops, NULL);
267
268 if (!armada_370_xp_mpic_domain)
269 panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
270
271 irq_set_default_host(armada_370_xp_mpic_domain);
272
273#ifdef CONFIG_SMP
274 armada_xp_mpic_smp_cpu_init();
275
276 /*
277 * Set the default affinity from all CPUs to the boot cpu.
278 * This is required since the MPIC doesn't limit several CPUs
279 * from acknowledging the same interrupt.
280 */
281 cpumask_clear(irq_default_affinity);
282 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
283
284#endif
285
286 set_handle_irq(armada_370_xp_handle_irq);
287
288 return 0;
289}
290
294IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init); 291IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);