aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-08 20:54:55 -0400
committerTony Lindgren <tony@atomide.com>2014-09-11 16:05:46 -0400
commita74f0a176e3e048df78816ec383b219f8ac6867e (patch)
tree90ddde5edffee7ac9ef8088f0366d43111d9b48a /arch/arm/mach-omap2
parent3384f86fe5c1074fddabeeeed72e413eb28f0fcf (diff)
arm: omap: irq: remove nr_irqs argument
we can set our global omap_nr_irqs early on and drop the extra argument to omap_init_irq(). Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/irq.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index a405b963c779..44d9cf4e74de 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -207,8 +207,7 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
207 IRQ_NOREQUEST | IRQ_NOPROBE, 0); 207 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
208} 208}
209 209
210static void __init omap_init_irq(u32 base, int nr_irqs, 210static void __init omap_init_irq(u32 base, struct device_node *node)
211 struct device_node *node)
212{ 211{
213 int j, irq_base; 212 int j, irq_base;
214 213
@@ -216,15 +215,13 @@ static void __init omap_init_irq(u32 base, int nr_irqs,
216 if (WARN_ON(!omap_irq_base)) 215 if (WARN_ON(!omap_irq_base))
217 return; 216 return;
218 217
219 omap_nr_irqs = nr_irqs; 218 irq_base = irq_alloc_descs(-1, 0, omap_nr_irqs, 0);
220
221 irq_base = irq_alloc_descs(-1, 0, nr_irqs, 0);
222 if (irq_base < 0) { 219 if (irq_base < 0) {
223 pr_warn("Couldn't allocate IRQ numbers\n"); 220 pr_warn("Couldn't allocate IRQ numbers\n");
224 irq_base = 0; 221 irq_base = 0;
225 } 222 }
226 223
227 domain = irq_domain_add_legacy(node, nr_irqs, irq_base, 0, 224 domain = irq_domain_add_legacy(node, omap_nr_irqs, irq_base, 0,
228 &irq_domain_simple_ops, NULL); 225 &irq_domain_simple_ops, NULL);
229 226
230 omap_irq_soft_reset(); 227 omap_irq_soft_reset();
@@ -278,19 +275,22 @@ out:
278 275
279void __init omap2_init_irq(void) 276void __init omap2_init_irq(void)
280{ 277{
281 omap_init_irq(OMAP24XX_IC_BASE, 96, NULL); 278 omap_nr_irqs = 96;
279 omap_init_irq(OMAP24XX_IC_BASE, NULL);
282 set_handle_irq(omap_intc_handle_irq); 280 set_handle_irq(omap_intc_handle_irq);
283} 281}
284 282
285void __init omap3_init_irq(void) 283void __init omap3_init_irq(void)
286{ 284{
287 omap_init_irq(OMAP34XX_IC_BASE, 96, NULL); 285 omap_nr_irqs = 96;
286 omap_init_irq(OMAP34XX_IC_BASE, NULL);
288 set_handle_irq(omap_intc_handle_irq); 287 set_handle_irq(omap_intc_handle_irq);
289} 288}
290 289
291void __init ti81xx_init_irq(void) 290void __init ti81xx_init_irq(void)
292{ 291{
293 omap_init_irq(OMAP34XX_IC_BASE, 128, NULL); 292 omap_nr_irqs = 96;
293 omap_init_irq(OMAP34XX_IC_BASE, NULL);
294 set_handle_irq(omap_intc_handle_irq); 294 set_handle_irq(omap_intc_handle_irq);
295} 295}
296 296
@@ -298,7 +298,8 @@ static int __init intc_of_init(struct device_node *node,
298 struct device_node *parent) 298 struct device_node *parent)
299{ 299{
300 struct resource res; 300 struct resource res;
301 u32 nr_irq = 96; 301
302 omap_nr_irqs = 96;
302 303
303 if (WARN_ON(!node)) 304 if (WARN_ON(!node))
304 return -ENODEV; 305 return -ENODEV;
@@ -309,9 +310,9 @@ static int __init intc_of_init(struct device_node *node,
309 } 310 }
310 311
311 if (of_device_is_compatible(node, "ti,am33xx-intc")) 312 if (of_device_is_compatible(node, "ti,am33xx-intc"))
312 nr_irq = 128; 313 omap_nr_irqs = 128;
313 314
314 omap_init_irq(res.start, nr_irq, of_node_get(node)); 315 omap_init_irq(res.start, of_node_get(node));
315 316
316 set_handle_irq(omap_intc_handle_irq); 317 set_handle_irq(omap_intc_handle_irq);
317 318