aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/intc/Makefile2
-rw-r--r--drivers/sh/intc/dynamic.c57
-rw-r--r--drivers/sh/intc/virq.c4
3 files changed, 4 insertions, 59 deletions
diff --git a/drivers/sh/intc/Makefile b/drivers/sh/intc/Makefile
index bb5df868d77a..44f006d09471 100644
--- a/drivers/sh/intc/Makefile
+++ b/drivers/sh/intc/Makefile
@@ -1,4 +1,4 @@
1obj-y := access.o chip.o core.o dynamic.o handle.o virq.o 1obj-y := access.o chip.o core.o handle.o virq.o
2 2
3obj-$(CONFIG_INTC_BALANCING) += balancing.o 3obj-$(CONFIG_INTC_BALANCING) += balancing.o
4obj-$(CONFIG_INTC_USERIMASK) += userimask.o 4obj-$(CONFIG_INTC_USERIMASK) += userimask.o
diff --git a/drivers/sh/intc/dynamic.c b/drivers/sh/intc/dynamic.c
deleted file mode 100644
index 14eb01ef5d72..000000000000
--- a/drivers/sh/intc/dynamic.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Dynamic IRQ management
3 *
4 * Copyright (C) 2010 Paul Mundt
5 *
6 * Modelled after arch/x86/kernel/apic/io_apic.c
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#define pr_fmt(fmt) "intc: " fmt
13
14#include <linux/irq.h>
15#include <linux/bitmap.h>
16#include <linux/spinlock.h>
17#include <linux/module.h>
18#include "internals.h" /* only for activate_irq() damage.. */
19
20/*
21 * The IRQ bitmap provides a global map of bound IRQ vectors for a
22 * given platform. Allocation of IRQs are either static through the CPU
23 * vector map, or dynamic in the case of board mux vectors or MSI.
24 *
25 * As this is a central point for all IRQ controllers on the system,
26 * each of the available sources are mapped out here. This combined with
27 * sparseirq makes it quite trivial to keep the vector map tightly packed
28 * when dynamically creating IRQs, as well as tying in to otherwise
29 * unused irq_desc positions in the sparse array.
30 */
31
32/*
33 * Dynamic IRQ allocation and deallocation
34 */
35unsigned int create_irq_nr(unsigned int irq_want, int node)
36{
37 int irq = irq_alloc_desc_at(irq_want, node);
38 if (irq < 0)
39 return 0;
40
41 activate_irq(irq);
42 return irq;
43}
44
45int create_irq(void)
46{
47 int irq = irq_alloc_desc(numa_node_id());
48 if (irq >= 0)
49 activate_irq(irq);
50
51 return irq;
52}
53
54void destroy_irq(unsigned int irq)
55{
56 irq_free_desc(irq);
57}
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c
index 93cec21e788b..f30ac9354ff2 100644
--- a/drivers/sh/intc/virq.c
+++ b/drivers/sh/intc/virq.c
@@ -219,12 +219,14 @@ restart:
219 if (radix_tree_deref_retry(entry)) 219 if (radix_tree_deref_retry(entry))
220 goto restart; 220 goto restart;
221 221
222 irq = create_irq(); 222 irq = irq_alloc_desc(numa_node_id());
223 if (unlikely(irq < 0)) { 223 if (unlikely(irq < 0)) {
224 pr_err("no more free IRQs, bailing..\n"); 224 pr_err("no more free IRQs, bailing..\n");
225 break; 225 break;
226 } 226 }
227 227
228 activate_irq(irq);
229
228 pr_info("Setting up a chained VIRQ from %d -> %d\n", 230 pr_info("Setting up a chained VIRQ from %d -> %d\n",
229 irq, entry->pirq); 231 irq, entry->pirq);
230 232