irq: irqdomain: Change irq_domain_add to detect errors
It should not be valid to add an irq_domain with a logical irq
range that overlaps with another already registered to the
system. Return an error on such an occurrence.
This change also inherently sorts the irq_domains by logical
irq_base as they are added.
Change-Id: Idef697dbe4584d783703d053fbf09f1b17e62ab0
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index ac0ab70..905b877 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -89,7 +89,7 @@
hw < d->hwirq_base + d->nr_irq; \
hw++, irq = irq_domain_to_irq(d, hw))
-extern void irq_domain_add(struct irq_domain *domain);
+extern int irq_domain_add(struct irq_domain *domain);
extern void irq_domain_del(struct irq_domain *domain);
extern void irq_domain_register(struct irq_domain *domain);
extern void irq_domain_register_irq(struct irq_domain *domain, int hwirq);