]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mfd/db8500-prcmu: use the irq_domain_add_simple()
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 18 Oct 2012 16:22:11 +0000 (18:22 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Nov 2012 08:55:34 +0000 (09:55 +0100)
To be able to use SPARSE_IRQ while yet not using device tree,
we need to use irq_domain_add_simple() that will allocate
descriptors for the IRQs in the non-DT case, and fall back
to using the linear irqdomain in the DT case.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/mfd/db8500-prcmu.c

index 00b8b0f3dfb6c998676958be96972476aa7773f3..cea29ba6ce9ae3a4df2bcbfe80ee2d65c07de4c8 100644 (file)
@@ -2697,9 +2697,15 @@ static struct irq_domain_ops db8500_irq_ops = {
 
 static int db8500_irq_init(struct device_node *np)
 {
-       db8500_irq_domain = irq_domain_add_legacy(
-               np, NUM_PRCMU_WAKEUPS, IRQ_PRCMU_BASE,
-               0, &db8500_irq_ops, NULL);
+       int irq_base = -1;
+
+       /* In the device tree case, just take some IRQs */
+       if (!np)
+               irq_base = IRQ_PRCMU_BASE;
+
+       db8500_irq_domain = irq_domain_add_simple(
+               np, NUM_PRCMU_WAKEUPS, irq_base,
+               &db8500_irq_ops, NULL);
 
        if (!db8500_irq_domain) {
                pr_err("Failed to create irqdomain\n");