diff options
-rw-r--r-- | arch/powerpc/platforms/ps3/interrupt.c | 24 | ||||
-rw-r--r-- | include/asm-powerpc/ps3.h | 3 |
2 files changed, 17 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c index 27afd1f0358a..3735cd14f614 100644 --- a/arch/powerpc/platforms/ps3/interrupt.c +++ b/arch/powerpc/platforms/ps3/interrupt.c | |||
@@ -85,7 +85,7 @@ struct ps3_private { | |||
85 | 85 | ||
86 | static DEFINE_PER_CPU(struct ps3_private, ps3_private); | 86 | static DEFINE_PER_CPU(struct ps3_private, ps3_private); |
87 | 87 | ||
88 | static int ps3_connect_irq(enum ps3_cpu_binding cpu, unsigned long outlet, | 88 | int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, |
89 | unsigned int *virq) | 89 | unsigned int *virq) |
90 | { | 90 | { |
91 | int result; | 91 | int result; |
@@ -138,8 +138,9 @@ fail_connect: | |||
138 | fail_create: | 138 | fail_create: |
139 | return result; | 139 | return result; |
140 | } | 140 | } |
141 | EXPORT_SYMBOL_GPL(ps3_alloc_irq); | ||
141 | 142 | ||
142 | static void ps3_disconnect_irq(unsigned int virq) | 143 | int ps3_free_irq(unsigned int virq) |
143 | { | 144 | { |
144 | int result; | 145 | int result; |
145 | const struct ps3_private *pd = get_irq_chip_data(virq); | 146 | const struct ps3_private *pd = get_irq_chip_data(virq); |
@@ -155,7 +156,9 @@ static void ps3_disconnect_irq(unsigned int virq) | |||
155 | 156 | ||
156 | set_irq_chip_data(virq, NULL); | 157 | set_irq_chip_data(virq, NULL); |
157 | irq_dispose_mapping(virq); | 158 | irq_dispose_mapping(virq); |
159 | return result; | ||
158 | } | 160 | } |
161 | EXPORT_SYMBOL_GPL(ps3_free_irq); | ||
159 | 162 | ||
160 | /** | 163 | /** |
161 | * ps3_alloc_io_irq - Assign a virq to a system bus device. | 164 | * ps3_alloc_io_irq - Assign a virq to a system bus device. |
@@ -182,7 +185,7 @@ int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id, | |||
182 | return result; | 185 | return result; |
183 | } | 186 | } |
184 | 187 | ||
185 | result = ps3_connect_irq(cpu, outlet, virq); | 188 | result = ps3_alloc_irq(cpu, outlet, virq); |
186 | BUG_ON(result); | 189 | BUG_ON(result); |
187 | 190 | ||
188 | return result; | 191 | return result; |
@@ -198,7 +201,7 @@ int ps3_free_io_irq(unsigned int virq) | |||
198 | pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n", | 201 | pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n", |
199 | __func__, __LINE__, ps3_result(result)); | 202 | __func__, __LINE__, ps3_result(result)); |
200 | 203 | ||
201 | ps3_disconnect_irq(virq); | 204 | ps3_free_irq(virq); |
202 | 205 | ||
203 | return result; | 206 | return result; |
204 | } | 207 | } |
@@ -228,7 +231,7 @@ int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq) | |||
228 | return result; | 231 | return result; |
229 | } | 232 | } |
230 | 233 | ||
231 | result = ps3_connect_irq(cpu, outlet, virq); | 234 | result = ps3_alloc_irq(cpu, outlet, virq); |
232 | BUG_ON(result); | 235 | BUG_ON(result); |
233 | 236 | ||
234 | return result; | 237 | return result; |
@@ -246,7 +249,7 @@ int ps3_free_event_irq(unsigned int virq) | |||
246 | pr_debug("%s:%d: lv1_destruct_event_receive_port failed: %s\n", | 249 | pr_debug("%s:%d: lv1_destruct_event_receive_port failed: %s\n", |
247 | __func__, __LINE__, ps3_result(result)); | 250 | __func__, __LINE__, ps3_result(result)); |
248 | 251 | ||
249 | ps3_disconnect_irq(virq); | 252 | ps3_free_irq(virq); |
250 | 253 | ||
251 | pr_debug(" <- %s:%d\n", __func__, __LINE__); | 254 | pr_debug(" <- %s:%d\n", __func__, __LINE__); |
252 | return result; | 255 | return result; |
@@ -350,7 +353,7 @@ int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp, | |||
350 | return result; | 353 | return result; |
351 | } | 354 | } |
352 | 355 | ||
353 | result = ps3_connect_irq(cpu, outlet, virq); | 356 | result = ps3_alloc_irq(cpu, outlet, virq); |
354 | BUG_ON(result); | 357 | BUG_ON(result); |
355 | 358 | ||
356 | return result; | 359 | return result; |
@@ -368,7 +371,7 @@ int ps3_free_vuart_irq(unsigned int virq) | |||
368 | return result; | 371 | return result; |
369 | } | 372 | } |
370 | 373 | ||
371 | ps3_disconnect_irq(virq); | 374 | ps3_free_irq(virq); |
372 | 375 | ||
373 | return result; | 376 | return result; |
374 | } | 377 | } |
@@ -399,7 +402,7 @@ int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, | |||
399 | return result; | 402 | return result; |
400 | } | 403 | } |
401 | 404 | ||
402 | result = ps3_connect_irq(cpu, outlet, virq); | 405 | result = ps3_alloc_irq(cpu, outlet, virq); |
403 | BUG_ON(result); | 406 | BUG_ON(result); |
404 | 407 | ||
405 | return result; | 408 | return result; |
@@ -407,10 +410,11 @@ int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, | |||
407 | 410 | ||
408 | int ps3_free_spe_irq(unsigned int virq) | 411 | int ps3_free_spe_irq(unsigned int virq) |
409 | { | 412 | { |
410 | ps3_disconnect_irq(virq); | 413 | ps3_free_irq(virq); |
411 | return 0; | 414 | return 0; |
412 | } | 415 | } |
413 | 416 | ||
417 | |||
414 | #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1) | 418 | #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1) |
415 | #define PS3_PLUG_MAX 63 | 419 | #define PS3_PLUG_MAX 63 |
416 | 420 | ||
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 021f802161a6..00a4c7d3c6d1 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
@@ -163,6 +163,9 @@ int ps3_free_vuart_irq(unsigned int virq); | |||
163 | int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, | 163 | int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, |
164 | unsigned int class, unsigned int *virq); | 164 | unsigned int class, unsigned int *virq); |
165 | int ps3_free_spe_irq(unsigned int virq); | 165 | int ps3_free_spe_irq(unsigned int virq); |
166 | int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, | ||
167 | unsigned int *virq); | ||
168 | int ps3_free_irq(unsigned int virq); | ||
166 | 169 | ||
167 | /* lv1 result codes */ | 170 | /* lv1 result codes */ |
168 | 171 | ||