sparseirq: Change irq_desc_ptrs to static
[pandora-kernel.git] / kernel / irq / handle.c
index 814940e..266f798 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/kernel_stat.h>
 #include <linux/rculist.h>
 #include <linux/hash.h>
-#include <linux/bootmem.h>
 #include <trace/events/irq.h>
 
 #include "internals.h"
@@ -87,12 +86,8 @@ void __ref init_kstat_irqs(struct irq_desc *desc, int node, int nr)
 {
        void *ptr;
 
-       if (slab_is_available())
-               ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs),
-                                  GFP_ATOMIC, node);
-       else
-               ptr = alloc_bootmem_node(NODE_DATA(node),
-                               nr * sizeof(*desc->kstat_irqs));
+       ptr = kzalloc_node(nr * sizeof(*desc->kstat_irqs),
+                          GFP_ATOMIC, node);
 
        /*
         * don't overwite if can not get new one
@@ -132,7 +127,7 @@ static void init_one_irq_desc(int irq, struct irq_desc *desc, int node)
  */
 DEFINE_RAW_SPINLOCK(sparse_irq_lock);
 
-struct irq_desc **irq_desc_ptrs __read_mostly;
+static struct irq_desc **irq_desc_ptrs __read_mostly;
 
 static struct irq_desc irq_desc_legacy[NR_IRQS_LEGACY] __cacheline_aligned_in_smp = {
        [0 ... NR_IRQS_LEGACY-1] = {
@@ -197,6 +192,11 @@ struct irq_desc *irq_to_desc(unsigned int irq)
        return NULL;
 }
 
+void replace_irq_desc(unsigned int irq, struct irq_desc *desc)
+{
+       irq_desc_ptrs[irq] = desc;
+}
+
 struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node)
 {
        struct irq_desc *desc;
@@ -219,10 +219,7 @@ struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node)
        if (desc)
                goto out_unlock;
 
-       if (slab_is_available())
-               desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
-       else
-               desc = alloc_bootmem_node(NODE_DATA(node), sizeof(*desc));
+       desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
 
        printk(KERN_DEBUG "  alloc irq_desc for %d on node %d\n", irq, node);
        if (!desc) {