diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-14 16:06:50 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-14 16:06:50 -0500 |
commit | bae1d8f19983fbfa25559aa3cb6a81a84aa82a18 (patch) | |
tree | 387012cc698159bfb5851c5022d5b55db2dafadc /arch/powerpc/platforms/embedded6xx/hlwd-pic.c | |
parent | 644bd954313254b54e08b69077e16831b6e04dfa (diff) |
irq_domain/powerpc: Use common irq_domain structure instead of irq_host
This patch drops the powerpc-specific irq_host structures and uses the common
irq_domain strucutres defined in linux/irqdomain.h. It also fixes all
the users to use the new structure names.
Renaming irq_host to irq_domain has been discussed for a long time, and this
patch is a step in the process of generalizing the powerpc virq code to be
usable by all architecture.
An astute reader will notice that this patch actually removes the irq_host
structure instead of renaming it. This is because the irq_domain structure
already exists in include/linux/irqdomain.h and has the needed data members.
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>
Diffstat (limited to 'arch/powerpc/platforms/embedded6xx/hlwd-pic.c')
-rw-r--r-- | arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c index e4919170c6bc..2d4a5d48fbbd 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c | |||
@@ -89,9 +89,9 @@ static struct irq_chip hlwd_pic = { | |||
89 | * | 89 | * |
90 | */ | 90 | */ |
91 | 91 | ||
92 | static struct irq_host *hlwd_irq_host; | 92 | static struct irq_domain *hlwd_irq_host; |
93 | 93 | ||
94 | static int hlwd_pic_map(struct irq_host *h, unsigned int virq, | 94 | static int hlwd_pic_map(struct irq_domain *h, unsigned int virq, |
95 | irq_hw_number_t hwirq) | 95 | irq_hw_number_t hwirq) |
96 | { | 96 | { |
97 | irq_set_chip_data(virq, h->host_data); | 97 | irq_set_chip_data(virq, h->host_data); |
@@ -100,11 +100,11 @@ static int hlwd_pic_map(struct irq_host *h, unsigned int virq, | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static struct irq_host_ops hlwd_irq_host_ops = { | 103 | static struct irq_domain_ops hlwd_irq_domain_ops = { |
104 | .map = hlwd_pic_map, | 104 | .map = hlwd_pic_map, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static unsigned int __hlwd_pic_get_irq(struct irq_host *h) | 107 | static unsigned int __hlwd_pic_get_irq(struct irq_domain *h) |
108 | { | 108 | { |
109 | void __iomem *io_base = h->host_data; | 109 | void __iomem *io_base = h->host_data; |
110 | int irq; | 110 | int irq; |
@@ -123,14 +123,14 @@ static void hlwd_pic_irq_cascade(unsigned int cascade_virq, | |||
123 | struct irq_desc *desc) | 123 | struct irq_desc *desc) |
124 | { | 124 | { |
125 | struct irq_chip *chip = irq_desc_get_chip(desc); | 125 | struct irq_chip *chip = irq_desc_get_chip(desc); |
126 | struct irq_host *irq_host = irq_get_handler_data(cascade_virq); | 126 | struct irq_domain *irq_domain = irq_get_handler_data(cascade_virq); |
127 | unsigned int virq; | 127 | unsigned int virq; |
128 | 128 | ||
129 | raw_spin_lock(&desc->lock); | 129 | raw_spin_lock(&desc->lock); |
130 | chip->irq_mask(&desc->irq_data); /* IRQ_LEVEL */ | 130 | chip->irq_mask(&desc->irq_data); /* IRQ_LEVEL */ |
131 | raw_spin_unlock(&desc->lock); | 131 | raw_spin_unlock(&desc->lock); |
132 | 132 | ||
133 | virq = __hlwd_pic_get_irq(irq_host); | 133 | virq = __hlwd_pic_get_irq(irq_domain); |
134 | if (virq != NO_IRQ) | 134 | if (virq != NO_IRQ) |
135 | generic_handle_irq(virq); | 135 | generic_handle_irq(virq); |
136 | else | 136 | else |
@@ -155,9 +155,9 @@ static void __hlwd_quiesce(void __iomem *io_base) | |||
155 | out_be32(io_base + HW_BROADWAY_ICR, 0xffffffff); | 155 | out_be32(io_base + HW_BROADWAY_ICR, 0xffffffff); |
156 | } | 156 | } |
157 | 157 | ||
158 | struct irq_host *hlwd_pic_init(struct device_node *np) | 158 | struct irq_domain *hlwd_pic_init(struct device_node *np) |
159 | { | 159 | { |
160 | struct irq_host *irq_host; | 160 | struct irq_domain *irq_domain; |
161 | struct resource res; | 161 | struct resource res; |
162 | void __iomem *io_base; | 162 | void __iomem *io_base; |
163 | int retval; | 163 | int retval; |
@@ -177,20 +177,20 @@ struct irq_host *hlwd_pic_init(struct device_node *np) | |||
177 | 177 | ||
178 | __hlwd_quiesce(io_base); | 178 | __hlwd_quiesce(io_base); |
179 | 179 | ||
180 | irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, HLWD_NR_IRQS, | 180 | irq_domain = irq_alloc_host(np, IRQ_DOMAIN_MAP_LINEAR, HLWD_NR_IRQS, |
181 | &hlwd_irq_host_ops, -1); | 181 | &hlwd_irq_domain_ops, -1); |
182 | if (!irq_host) { | 182 | if (!irq_domain) { |
183 | pr_err("failed to allocate irq_host\n"); | 183 | pr_err("failed to allocate irq_domain\n"); |
184 | return NULL; | 184 | return NULL; |
185 | } | 185 | } |
186 | irq_host->host_data = io_base; | 186 | irq_domain->host_data = io_base; |
187 | 187 | ||
188 | return irq_host; | 188 | return irq_domain; |
189 | } | 189 | } |
190 | 190 | ||
191 | unsigned int hlwd_pic_get_irq(void) | 191 | unsigned int hlwd_pic_get_irq(void) |
192 | { | 192 | { |
193 | return __hlwd_pic_get_irq(hlwd_irq_host); | 193 | return __hlwd_pic_get_irq(hlwd_irq_domain); |
194 | } | 194 | } |
195 | 195 | ||
196 | /* | 196 | /* |
@@ -200,7 +200,7 @@ unsigned int hlwd_pic_get_irq(void) | |||
200 | 200 | ||
201 | void hlwd_pic_probe(void) | 201 | void hlwd_pic_probe(void) |
202 | { | 202 | { |
203 | struct irq_host *host; | 203 | struct irq_domain *host; |
204 | struct device_node *np; | 204 | struct device_node *np; |
205 | const u32 *interrupts; | 205 | const u32 *interrupts; |
206 | int cascade_virq; | 206 | int cascade_virq; |
@@ -214,7 +214,7 @@ void hlwd_pic_probe(void) | |||
214 | irq_set_handler_data(cascade_virq, host); | 214 | irq_set_handler_data(cascade_virq, host); |
215 | irq_set_chained_handler(cascade_virq, | 215 | irq_set_chained_handler(cascade_virq, |
216 | hlwd_pic_irq_cascade); | 216 | hlwd_pic_irq_cascade); |
217 | hlwd_irq_host = host; | 217 | hlwd_irq_domain = host; |
218 | break; | 218 | break; |
219 | } | 219 | } |
220 | } | 220 | } |
@@ -228,7 +228,7 @@ void hlwd_pic_probe(void) | |||
228 | */ | 228 | */ |
229 | void hlwd_quiesce(void) | 229 | void hlwd_quiesce(void) |
230 | { | 230 | { |
231 | void __iomem *io_base = hlwd_irq_host->host_data; | 231 | void __iomem *io_base = hlwd_irq_domain->host_data; |
232 | 232 | ||
233 | __hlwd_quiesce(io_base); | 233 | __hlwd_quiesce(io_base); |
234 | } | 234 | } |