diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-10-16 13:50:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-10-18 06:11:16 -0400 |
commit | 07c9249f1fa90cc8189bed44c0bcece664596a72 (patch) | |
tree | c769265892c802ff94c350b913ecb78d73786c80 /arch/arm/common | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
ARM: 7554/1: VIC: use irq_domain_add_simple()
Instead of allocating descriptors on-the-fly for the device tree
initialization case, use irq_domain_add_simple() which will take
care of this if you pass negative as the first_irq.
Alter the signature of __vic_init() to pass the first_irq as
signed so this works as expected.
Switching the VIC to use irq_domain_add_simple() also has the
upside of displaying the same WARNING when you boot with
pre-allocated descriptors on systems using SPARSE_IRQ but
yet not using device tree.
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/vic.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e0d538803cc3..4fd5d980edde 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -218,7 +218,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq, | |||
218 | v->resume_sources = resume_sources; | 218 | v->resume_sources = resume_sources; |
219 | v->irq = irq; | 219 | v->irq = irq; |
220 | vic_id++; | 220 | vic_id++; |
221 | v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0, | 221 | v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, |
222 | &vic_irqdomain_ops, v); | 222 | &vic_irqdomain_ops, v); |
223 | } | 223 | } |
224 | 224 | ||
@@ -350,7 +350,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
350 | vic_register(base, irq_start, vic_sources, 0, node); | 350 | vic_register(base, irq_start, vic_sources, 0, node); |
351 | } | 351 | } |
352 | 352 | ||
353 | void __init __vic_init(void __iomem *base, unsigned int irq_start, | 353 | void __init __vic_init(void __iomem *base, int irq_start, |
354 | u32 vic_sources, u32 resume_sources, | 354 | u32 vic_sources, u32 resume_sources, |
355 | struct device_node *node) | 355 | struct device_node *node) |
356 | { | 356 | { |
@@ -416,18 +416,12 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) | |||
416 | if (WARN_ON(!regs)) | 416 | if (WARN_ON(!regs)) |
417 | return -EIO; | 417 | return -EIO; |
418 | 418 | ||
419 | irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); | 419 | /* |
420 | if (WARN_ON(irq_base < 0)) | 420 | * Passing -1 as first IRQ makes the simple domain allocate descriptors |
421 | goto out_unmap; | 421 | */ |
422 | 422 | __vic_init(regs, -1, ~0, ~0, node); | |
423 | __vic_init(regs, irq_base, ~0, ~0, node); | ||
424 | 423 | ||
425 | return 0; | 424 | return 0; |
426 | |||
427 | out_unmap: | ||
428 | iounmap(regs); | ||
429 | |||
430 | return -EIO; | ||
431 | } | 425 | } |
432 | #endif /* CONFIG OF */ | 426 | #endif /* CONFIG OF */ |
433 | 427 | ||