diff options
author | Rob Herring <rob.herring@calxeda.com> | 2011-09-30 10:48:38 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 14:03:23 +0100 |
commit | 6d274309d0e64bdbdb6c50945ca2964596e8fa5a (patch) | |
tree | 4b4c40a0a75b3e261f08e1525b5cc0e0bd781676 /kernel/irq/irqdomain.c | |
parent | c71a54b0820179e53483d5220cdef1a0df8d5bd1 (diff) | |
download | kernel_goldelico_gta04-6d274309d0e64bdbdb6c50945ca2964596e8fa5a.zip kernel_goldelico_gta04-6d274309d0e64bdbdb6c50945ca2964596e8fa5a.tar.gz kernel_goldelico_gta04-6d274309d0e64bdbdb6c50945ca2964596e8fa5a.tar.bz2 |
irq: support domains with non-zero hwirq base
Interrupt controllers can have non-zero starting value for h/w irq numbers.
Adding support in irq_domain allows the domain hwirq numbering to match
the interrupt controllers' numbering.
As this makes looping over irqs for a domain more complicated, add loop
iterators to iterate over all hwirqs and irqs for a domain.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/irqdomain.c')
-rw-r--r-- | kernel/irq/irqdomain.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index b57a377..200ce83 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -20,15 +20,15 @@ static DEFINE_MUTEX(irq_domain_mutex); void irq_domain_add(struct irq_domain *domain) { struct irq_data *d; - int hwirq; + int hwirq, irq; /* * This assumes that the irq_domain owner has already allocated * the irq_descs. This block will be removed when support for dynamic * allocation of irq_descs is added to irq_domain. */ - for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) { - d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq)); + irq_domain_for_each_irq(domain, hwirq, irq) { + d = irq_get_irq_data(irq); if (!d) { WARN(1, "error: assigning domain to non existant irq_desc"); return; @@ -54,15 +54,15 @@ void irq_domain_add(struct irq_domain *domain) void irq_domain_del(struct irq_domain *domain) { struct irq_data *d; - int hwirq; + int hwirq, irq; mutex_lock(&irq_domain_mutex); list_del(&domain->list); mutex_unlock(&irq_domain_mutex); /* Clear the irq_domain assignments */ - for (hwirq = 0; hwirq < domain->nr_irq; hwirq++) { - d = irq_get_irq_data(irq_domain_to_irq(domain, hwirq)); + irq_domain_for_each_irq(domain, hwirq, irq) { + d = irq_get_irq_data(irq); d->domain = NULL; } } |