From: Thomas Gleixner Date: Thu, 29 Jun 2006 09:24:49 +0000 (-0700) Subject: [PATCH] genirq: add IRQ_NOREQUEST support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6550c775cb5ee94c132d93d84de3bb23f0abf37b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] genirq: add IRQ_NOREQUEST support Enable platforms to disable request_irq() for certain interrupts. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/irq.h b/include/linux/irq.h index b2fcf330cf2e..1df49ec7f820 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -41,6 +41,7 @@ #endif #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 * diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 90a944a7fadc..cae900a849c4 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -141,7 +141,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags) { struct irqaction *action; - if (irq >= NR_IRQS) + if (irq >= NR_IRQS || irq_desc[irq].status & IRQ_NOREQUEST) return 0; action = irq_desc[irq].action; @@ -356,6 +356,8 @@ int request_irq(unsigned int irq, return -EINVAL; if (irq >= NR_IRQS) return -EINVAL; + if (irq_desc[irq].status & IRQ_NOREQUEST) + return -EINVAL; if (!handler) return -EINVAL;