diff options
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 30fb8e2c5c9d..d5c7e4cf2b39 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -418,6 +418,11 @@ irq_hw_number_t virq_to_hw(unsigned int virq) | |||
418 | } | 418 | } |
419 | EXPORT_SYMBOL_GPL(virq_to_hw); | 419 | EXPORT_SYMBOL_GPL(virq_to_hw); |
420 | 420 | ||
421 | static int default_irq_host_match(struct irq_host *h, struct device_node *np) | ||
422 | { | ||
423 | return h->of_node != NULL && h->of_node == np; | ||
424 | } | ||
425 | |||
421 | __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, | 426 | __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, |
422 | unsigned int revmap_type, | 427 | unsigned int revmap_type, |
423 | unsigned int revmap_arg, | 428 | unsigned int revmap_arg, |
@@ -449,6 +454,9 @@ __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node, | |||
449 | host->ops = ops; | 454 | host->ops = ops; |
450 | host->of_node = of_node; | 455 | host->of_node = of_node; |
451 | 456 | ||
457 | if (host->ops->match == NULL) | ||
458 | host->ops->match = default_irq_host_match; | ||
459 | |||
452 | spin_lock_irqsave(&irq_big_lock, flags); | 460 | spin_lock_irqsave(&irq_big_lock, flags); |
453 | 461 | ||
454 | /* If it's a legacy controller, check for duplicates and | 462 | /* If it's a legacy controller, check for duplicates and |
@@ -523,7 +531,7 @@ struct irq_host *irq_find_host(struct device_node *node) | |||
523 | */ | 531 | */ |
524 | spin_lock_irqsave(&irq_big_lock, flags); | 532 | spin_lock_irqsave(&irq_big_lock, flags); |
525 | list_for_each_entry(h, &irq_hosts, link) | 533 | list_for_each_entry(h, &irq_hosts, link) |
526 | if (h->ops->match != NULL && h->ops->match(h, node)) { | 534 | if (h->ops->match(h, node)) { |
527 | found = h; | 535 | found = h; |
528 | break; | 536 | break; |
529 | } | 537 | } |