diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-06-04 01:04:38 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-07-11 11:16:13 -0400 |
commit | 9844a5524ec532aee826c35e3031637c7fc8287b (patch) | |
tree | 3fd2d2bd4ecdb8252d66f1f8c30d4a03e270ea0d /kernel/irq | |
parent | d6b0d1f7058f7cf818138cd7fd116dca3f3576d9 (diff) |
irqdomain: Fix irq_create_direct_mapping() to test irq_domain type.
irq_create_direct_mapping can only be used with the NOMAP type. Make
the function test to ensure it is passed the correct type of
irq_domain.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/irqdomain.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index f540bb1eff84..c0e638ba9c2a 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -481,8 +481,8 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain) | |||
481 | if (domain == NULL) | 481 | if (domain == NULL) |
482 | domain = irq_default_domain; | 482 | domain = irq_default_domain; |
483 | 483 | ||
484 | BUG_ON(domain == NULL); | 484 | if (WARN_ON(!domain || domain->revmap_type != IRQ_DOMAIN_MAP_NOMAP)) |
485 | WARN_ON(domain->revmap_type != IRQ_DOMAIN_MAP_NOMAP); | 485 | return 0; |
486 | 486 | ||
487 | virq = irq_alloc_desc_from(1, of_node_to_nid(domain->of_node)); | 487 | virq = irq_alloc_desc_from(1, of_node_to_nid(domain->of_node)); |
488 | if (!virq) { | 488 | if (!virq) { |