Skip to content

Commit

Permalink
irqdomain: Fix irq_create_direct_mapping() to test irq_domain type.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Grant Likely committed Jul 11, 2012
1 parent d6b0d1f commit 9844a55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain)
if (domain == NULL)
domain = irq_default_domain;

BUG_ON(domain == NULL);
WARN_ON(domain->revmap_type != IRQ_DOMAIN_MAP_NOMAP);
if (WARN_ON(!domain || domain->revmap_type != IRQ_DOMAIN_MAP_NOMAP))
return 0;

virq = irq_alloc_desc_from(1, of_node_to_nid(domain->of_node));
if (!virq) {
Expand Down

0 comments on commit 9844a55

Please sign in to comment.