Commit 6550c775 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] genirq: add IRQ_NOREQUEST support

Enable platforms to disable request_irq() for certain interrupts.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3418d724
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#endif #endif
#define IRQ_NOPROBE 512 /* IRQ is not valid for probing */ #define IRQ_NOPROBE 512 /* IRQ is not valid for probing */
#define IRQ_NOREQUEST 1024 /* IRQ cannot be requested */
/** /**
* struct hw_interrupt_type - hardware interrupt type descriptor * struct hw_interrupt_type - hardware interrupt type descriptor
* *
......
...@@ -141,7 +141,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags) ...@@ -141,7 +141,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags)
{ {
struct irqaction *action; struct irqaction *action;
if (irq >= NR_IRQS) if (irq >= NR_IRQS || irq_desc[irq].status & IRQ_NOREQUEST)
return 0; return 0;
action = irq_desc[irq].action; action = irq_desc[irq].action;
...@@ -356,6 +356,8 @@ int request_irq(unsigned int irq, ...@@ -356,6 +356,8 @@ int request_irq(unsigned int irq,
return -EINVAL; return -EINVAL;
if (irq >= NR_IRQS) if (irq >= NR_IRQS)
return -EINVAL; return -EINVAL;
if (irq_desc[irq].status & IRQ_NOREQUEST)
return -EINVAL;
if (!handler) if (!handler)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment