summaryrefslogtreecommitdiffstats
path: root/kernel/irq/proc.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-30 02:46:07 +0200
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 16:39:07 +0200
commit13bfe99e09123ef5edb6acb81ba337d2db600b53 (patch)
treef96f5be41c90e1ab437bb40a02a8f137deb9e3ab /kernel/irq/proc.c
parent1f5a5b87f78fade3ae48dfd55e8765d1d622ea4e (diff)
downloadlinux-13bfe99e09123ef5edb6acb81ba337d2db600b53.tar.gz
linux-13bfe99e09123ef5edb6acb81ba337d2db600b53.tar.bz2
linux-13bfe99e09123ef5edb6acb81ba337d2db600b53.zip
genirq: Prepare proc for real sparse irq support
/proc/irq never removes any entries, but when irq descriptors can be freed for real this is necessary. Otherwise we'd reference a freed descriptor in /proc/irq/N Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r--kernel/irq/proc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index d9fddf918b41..01b1d3a88983 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -297,6 +297,24 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
&irq_spurious_proc_fops, (void *)(long)irq);
}
+void unregister_irq_proc(unsigned int irq, struct irq_desc *desc)
+{
+ char name [MAX_NAMELEN];
+
+ if (!root_irq_dir || !desc->dir)
+ return;
+#ifdef CONFIG_SMP
+ remove_proc_entry("smp_affinity", desc->dir);
+ remove_proc_entry("affinity_hint", desc->dir);
+ remove_proc_entry("node", desc->dir);
+#endif
+ remove_proc_entry("spurious", desc->dir);
+
+ memset(name, 0, MAX_NAMELEN);
+ sprintf(name, "%u", irq);
+ remove_proc_entry(name, root_irq_dir);
+}
+
#undef MAX_NAMELEN
void unregister_handler_proc(unsigned int irq, struct irqaction *action)