mfd/ab8500-core: use irq_domain_add_simple()
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 18 Oct 2012 16:18:44 +0000 (18:18 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Nov 2012 08:55:33 +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/ab8500-core.c

index 1667c77..547fff4 100644 (file)
@@ -565,15 +565,10 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
        else
                num_irqs = AB8500_NR_IRQS;
 
-       if (ab8500->irq_base) {
-               ab8500->domain = irq_domain_add_legacy(
-                       NULL, num_irqs, ab8500->irq_base,
-                       0, &ab8500_irq_ops, ab8500);
-       }
-       else {
-               ab8500->domain = irq_domain_add_linear(
-                       np, num_irqs, &ab8500_irq_ops, ab8500);
-       }
+       /* If ->irq_base is zero this will give a linear mapping */
+       ab8500->domain = irq_domain_add_simple(NULL,
+                       num_irqs, ab8500->irq_base,
+                       &ab8500_irq_ops, ab8500);
 
        if (!ab8500->domain) {
                dev_err(ab8500->dev, "Failed to create irqdomain\n");