aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-02-14 16:06:53 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-02-16 08:11:22 -0500
commit68700650e71b6bb6636673f4f9c8ec807353d8d6 (patch)
treeca25ab4c37e7d2e1c9a962a33f8ff50341479116
parent03848373ea741caafab952fb62405ed7fc0c279c (diff)
irq_domain: Remove references to old irq_host names
No functional changes. Replaces non-exported references to 'host' with domain. Does not change any symbol names referenced by other .c files. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Milton Miller <miltonm@bga.com> Tested-by: Olof Johansson <olof@lixom.net>
-rw-r--r--kernel/irq/irqdomain.c219
1 files changed, 108 insertions, 111 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 8f7b91ce53c4..432d292b33f8 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -19,11 +19,11 @@ static DEFINE_MUTEX(irq_domain_mutex);
19#ifdef CONFIG_PPC 19#ifdef CONFIG_PPC
20static DEFINE_MUTEX(revmap_trees_mutex); 20static DEFINE_MUTEX(revmap_trees_mutex);
21static unsigned int irq_virq_count = NR_IRQS; 21static unsigned int irq_virq_count = NR_IRQS;
22static struct irq_domain *irq_default_host; 22static struct irq_domain *irq_default_domain;
23 23
24static int default_irq_host_match(struct irq_domain *h, struct device_node *np) 24static int default_irq_domain_match(struct irq_domain *d, struct device_node *np)
25{ 25{
26 return h->of_node != NULL && h->of_node == np; 26 return d->of_node != NULL && d->of_node == np;
27} 27}
28 28
29/** 29/**
@@ -31,8 +31,8 @@ static int default_irq_host_match(struct irq_domain *h, struct device_node *np)
31 * @of_node: optional device-tree node of the interrupt controller 31 * @of_node: optional device-tree node of the interrupt controller
32 * @revmap_type: type of reverse mapping to use 32 * @revmap_type: type of reverse mapping to use
33 * @revmap_arg: for IRQ_DOMAIN_MAP_LINEAR linear only: size of the map 33 * @revmap_arg: for IRQ_DOMAIN_MAP_LINEAR linear only: size of the map
34 * @ops: map/unmap host callbacks 34 * @ops: map/unmap domain callbacks
35 * @inval_irq: provide a hw number in that host space that is always invalid 35 * @inval_irq: provide a hw number in that domain space that is always invalid
36 * 36 *
37 * Allocates and initialize and irq_domain structure. Note that in the case of 37 * Allocates and initialize and irq_domain structure. Note that in the case of
38 * IRQ_DOMAIN_MAP_LEGACY, the map() callback will be called before this returns 38 * IRQ_DOMAIN_MAP_LEGACY, the map() callback will be called before this returns
@@ -48,7 +48,7 @@ struct irq_domain *irq_alloc_host(struct device_node *of_node,
48 struct irq_domain_ops *ops, 48 struct irq_domain_ops *ops,
49 irq_hw_number_t inval_irq) 49 irq_hw_number_t inval_irq)
50{ 50{
51 struct irq_domain *host, *h; 51 struct irq_domain *domain, *h;
52 unsigned int size = sizeof(struct irq_domain); 52 unsigned int size = sizeof(struct irq_domain);
53 unsigned int i; 53 unsigned int i;
54 unsigned int *rmap; 54 unsigned int *rmap;
@@ -56,18 +56,18 @@ struct irq_domain *irq_alloc_host(struct device_node *of_node,
56 /* Allocate structure and revmap table if using linear mapping */ 56 /* Allocate structure and revmap table if using linear mapping */
57 if (revmap_type == IRQ_DOMAIN_MAP_LINEAR) 57 if (revmap_type == IRQ_DOMAIN_MAP_LINEAR)
58 size += revmap_arg * sizeof(unsigned int); 58 size += revmap_arg * sizeof(unsigned int);
59 host = kzalloc(size, GFP_KERNEL); 59 domain = kzalloc(size, GFP_KERNEL);
60 if (host == NULL) 60 if (domain == NULL)
61 return NULL; 61 return NULL;
62 62
63 /* Fill structure */ 63 /* Fill structure */
64 host->revmap_type = revmap_type; 64 domain->revmap_type = revmap_type;
65 host->inval_irq = inval_irq; 65 domain->inval_irq = inval_irq;
66 host->ops = ops; 66 domain->ops = ops;
67 host->of_node = of_node_get(of_node); 67 domain->of_node = of_node_get(of_node);
68 68
69 if (host->ops->match == NULL) 69 if (domain->ops->match == NULL)
70 host->ops->match = default_irq_host_match; 70 domain->ops->match = default_irq_domain_match;
71 71
72 mutex_lock(&irq_domain_mutex); 72 mutex_lock(&irq_domain_mutex);
73 /* Make sure only one legacy controller can be created */ 73 /* Make sure only one legacy controller can be created */
@@ -75,53 +75,53 @@ struct irq_domain *irq_alloc_host(struct device_node *of_node,
75 list_for_each_entry(h, &irq_domain_list, link) { 75 list_for_each_entry(h, &irq_domain_list, link) {
76 if (WARN_ON(h->revmap_type == IRQ_DOMAIN_MAP_LEGACY)) { 76 if (WARN_ON(h->revmap_type == IRQ_DOMAIN_MAP_LEGACY)) {
77 mutex_unlock(&irq_domain_mutex); 77 mutex_unlock(&irq_domain_mutex);
78 of_node_put(host->of_node); 78 of_node_put(domain->of_node);
79 kfree(host); 79 kfree(domain);
80 return NULL; 80 return NULL;
81 } 81 }
82 } 82 }
83 } 83 }
84 list_add(&host->link, &irq_domain_list); 84 list_add(&domain->link, &irq_domain_list);
85 mutex_unlock(&irq_domain_mutex); 85 mutex_unlock(&irq_domain_mutex);
86 86
87 /* Additional setups per revmap type */ 87 /* Additional setups per revmap type */
88 switch(revmap_type) { 88 switch(revmap_type) {
89 case IRQ_DOMAIN_MAP_LEGACY: 89 case IRQ_DOMAIN_MAP_LEGACY:
90 /* 0 is always the invalid number for legacy */ 90 /* 0 is always the invalid number for legacy */
91 host->inval_irq = 0; 91 domain->inval_irq = 0;
92 /* setup us as the host for all legacy interrupts */ 92 /* setup us as the domain for all legacy interrupts */
93 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { 93 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) {
94 struct irq_data *irq_data = irq_get_irq_data(i); 94 struct irq_data *irq_data = irq_get_irq_data(i);
95 irq_data->hwirq = i; 95 irq_data->hwirq = i;
96 irq_data->domain = host; 96 irq_data->domain = domain;
97 97
98 /* Legacy flags are left to default at this point, 98 /* Legacy flags are left to default at this point,
99 * one can then use irq_create_mapping() to 99 * one can then use irq_create_mapping() to
100 * explicitly change them 100 * explicitly change them
101 */ 101 */
102 ops->map(host, i, i); 102 ops->map(domain, i, i);
103 103
104 /* Clear norequest flags */ 104 /* Clear norequest flags */
105 irq_clear_status_flags(i, IRQ_NOREQUEST); 105 irq_clear_status_flags(i, IRQ_NOREQUEST);
106 } 106 }
107 break; 107 break;
108 case IRQ_DOMAIN_MAP_LINEAR: 108 case IRQ_DOMAIN_MAP_LINEAR:
109 rmap = (unsigned int *)(host + 1); 109 rmap = (unsigned int *)(domain + 1);
110 for (i = 0; i < revmap_arg; i++) 110 for (i = 0; i < revmap_arg; i++)
111 rmap[i] = 0; 111 rmap[i] = 0;
112 host->revmap_data.linear.size = revmap_arg; 112 domain->revmap_data.linear.size = revmap_arg;
113 host->revmap_data.linear.revmap = rmap; 113 domain->revmap_data.linear.revmap = rmap;
114 break; 114 break;
115 case IRQ_DOMAIN_MAP_TREE: 115 case IRQ_DOMAIN_MAP_TREE:
116 INIT_RADIX_TREE(&host->revmap_data.tree, GFP_KERNEL); 116 INIT_RADIX_TREE(&domain->revmap_data.tree, GFP_KERNEL);
117 break; 117 break;
118 default: 118 default:
119 break; 119 break;
120 } 120 }
121 121
122 pr_debug("irq: Allocated host of type %d @0x%p\n", revmap_type, host); 122 pr_debug("irq: Allocated domain of type %d @0x%p\n", revmap_type, domain);
123 123
124 return host; 124 return domain;
125} 125}
126 126
127/** 127/**
@@ -150,18 +150,18 @@ EXPORT_SYMBOL_GPL(irq_find_host);
150 150
151/** 151/**
152 * irq_set_default_host() - Set a "default" irq domain 152 * irq_set_default_host() - Set a "default" irq domain
153 * @host: default host pointer 153 * @domain: default domain pointer
154 * 154 *
155 * For convenience, it's possible to set a "default" domain that will be used 155 * For convenience, it's possible to set a "default" domain that will be used
156 * whenever NULL is passed to irq_create_mapping(). It makes life easier for 156 * whenever NULL is passed to irq_create_mapping(). It makes life easier for
157 * platforms that want to manipulate a few hard coded interrupt numbers that 157 * platforms that want to manipulate a few hard coded interrupt numbers that
158 * aren't properly represented in the device-tree. 158 * aren't properly represented in the device-tree.
159 */ 159 */
160void irq_set_default_host(struct irq_domain *host) 160void irq_set_default_host(struct irq_domain *domain)
161{ 161{
162 pr_debug("irq: Default host set to @0x%p\n", host); 162 pr_debug("irq: Default domain set to @0x%p\n", domain);
163 163
164 irq_default_host = host; 164 irq_default_domain = domain;
165} 165}
166 166