diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-11-15 22:24:01 +0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-11-23 13:01:46 +0100 |
commit | 36d727310cb9f85efb5ac089ffb1797e7c3538e1 (patch) | |
tree | e58639a6b10598f89db6adc66b03145ab1841f45 /include/linux/irqdomain.h | |
parent | 1b5377087cb4e68d719a875120894fddfbcbf0f9 (diff) | |
download | blackbird-obmc-linux-36d727310cb9f85efb5ac089ffb1797e7c3538e1.tar.gz blackbird-obmc-linux-36d727310cb9f85efb5ac089ffb1797e7c3538e1.zip |
irqdomain: Implement a method to automatically call parent domains alloc/free
Add a flags to irq_domain.flags to control whether the irqdomain core
should automatically call parent irqdomain's alloc/free callbacks. It
help to reduce hierarchy irqdomains users' code size.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Link: http://lkml.kernel.org/r/1416061447-9472-4-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/irqdomain.h')
-rw-r--r-- | include/linux/irqdomain.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 7aca1adb68a1..dd2709bdad56 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -134,6 +134,9 @@ enum { /* Irq domain is hierarchical */ IRQ_DOMAIN_FLAG_HIERARCHY = (1 << 0), + /* Core calls alloc/free recursive through the domain hierarchy. */ + IRQ_DOMAIN_FLAG_AUTO_RECURSIVE = (1 << 1), + /* * Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved * for implementation specific purposes and ignored by the @@ -285,22 +288,13 @@ extern void irq_domain_free_irqs_common(struct irq_domain *domain, extern void irq_domain_free_irqs_top(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs); -static inline int irq_domain_alloc_irqs_parent(struct irq_domain *domain, - unsigned int irq_base, - unsigned int nr_irqs, void *arg) -{ - if (domain->parent && domain->parent->ops->alloc) - return domain->parent->ops->alloc(domain->parent, irq_base, - nr_irqs, arg); - return -ENOSYS; -} +extern int irq_domain_alloc_irqs_parent(struct irq_domain *domain, + unsigned int irq_base, + unsigned int nr_irqs, void *arg); -static inline void irq_domain_free_irqs_parent(struct irq_domain *domain, - unsigned int irq_base, unsigned int nr_irqs) -{ - if (domain->parent && domain->parent->ops->free) - domain->parent->ops->free(domain->parent, irq_base, nr_irqs); -} +extern void irq_domain_free_irqs_parent(struct irq_domain *domain, + unsigned int irq_base, + unsigned int nr_irqs); static inline bool irq_domain_is_hierarchy(struct irq_domain *domain) { |