diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2009-10-13 15:44:51 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-10-30 02:20:55 -0400 |
commit | 6cff46f4bc6cc4a8a4154b0b6a2e669db08e8fd2 (patch) | |
tree | cdd88dcd639968abe5b0f5ff7b06dc230ec790b1 /arch/powerpc/kernel | |
parent | 59e3f837023d446924791f76fbdd4bcf8e09efcc (diff) |
powerpc: Remove get_irq_desc()
get_irq_desc() is a powerpc-specific version of irq_to_desc(). That
is reason enough to remove it, but it also doesn't know about sparse
irq_desc support which irq_to_desc() does (when we enable it).
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/crash.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 28 |
2 files changed, 16 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 0a8439aafdd1..6f4613dd05ef 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
@@ -373,7 +373,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs) | |||
373 | hard_irq_disable(); | 373 | hard_irq_disable(); |
374 | 374 | ||
375 | for_each_irq(i) { | 375 | for_each_irq(i) { |
376 | struct irq_desc *desc = irq_desc + i; | 376 | struct irq_desc *desc = irq_to_desc(i); |
377 | 377 | ||
378 | if (desc->status & IRQ_INPROGRESS) | 378 | if (desc->status & IRQ_INPROGRESS) |
379 | desc->chip->eoi(i); | 379 | desc->chip->eoi(i); |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index e5d121177984..65632215f020 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -190,7 +190,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | if (i < NR_IRQS) { | 192 | if (i < NR_IRQS) { |
193 | desc = get_irq_desc(i); | 193 | desc = irq_to_desc(i); |
194 | spin_lock_irqsave(&desc->lock, flags); | 194 | spin_lock_irqsave(&desc->lock, flags); |
195 | action = desc->action; | 195 | action = desc->action; |
196 | if (!action || !action->handler) | 196 | if (!action || !action->handler) |
@@ -230,23 +230,25 @@ skip: | |||
230 | #ifdef CONFIG_HOTPLUG_CPU | 230 | #ifdef CONFIG_HOTPLUG_CPU |
231 | void fixup_irqs(cpumask_t map) | 231 | void fixup_irqs(cpumask_t map) |
232 | { | 232 | { |
233 | struct irq_desc *desc; | ||
233 | unsigned int irq; | 234 | unsigned int irq; |
234 | static int warned; | 235 | static int warned; |
235 | 236 | ||
236 | for_each_irq(irq) { | 237 | for_each_irq(irq) { |
237 | cpumask_t mask; | 238 | cpumask_t mask; |
238 | 239 | ||
239 | if (irq_desc[irq].status & IRQ_PER_CPU) | 240 | desc = irq_to_desc(irq); |
241 | if (desc && desc->status & IRQ_PER_CPU) | ||
240 | continue; | 242 | continue; |
241 | 243 | ||
242 | cpumask_and(&mask, irq_desc[irq].affinity, &map); | 244 | cpumask_and(&mask, desc->affinity, &map); |
243 | if (any_online_cpu(mask) == NR_CPUS) { | 245 | if (any_online_cpu(mask) == NR_CPUS) { |
244 | printk("Breaking affinity for irq %i\n", irq); | 246 | printk("Breaking affinity for irq %i\n", irq); |
245 | mask = map; | 247 | mask = map; |
246 | } | 248 | } |
247 | if (irq_desc[irq].chip->set_affinity) | 249 | if (desc->chip->set_affinity) |
248 | irq_desc[irq].chip->set_affinity(irq, &mask); | 250 | desc->chip->set_affinity(irq, &mask); |
249 | else if (irq_desc[irq].action && !(warned++)) | 251 | else if (desc->action && !(warned++)) |
250 | printk("Cannot set affinity for irq %i\n", irq); | 252 | printk("Cannot set affinity for irq %i\n", irq); |
251 | } | 253 | } |
252 | 254 | ||
@@ -273,7 +275,7 @@ static inline void handle_one_irq(unsigned int irq) | |||
273 | return; | 275 | return; |
274 | } | 276 | } |
275 | 277 | ||
276 | desc = irq_desc + irq; | 278 | desc = irq_to_desc(irq); |
277 | saved_sp_limit = current->thread.ksp_limit; | 279 | saved_sp_limit = current->thread.ksp_limit; |
278 | 280 | ||
279 | irqtp->task = curtp->task; | 281 | irqtp->task = curtp->task; |
@@ -535,7 +537,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node, | |||
535 | smp_wmb(); | 537 | smp_wmb(); |
536 | 538 | ||
537 | /* Clear norequest flags */ | 539 | /* Clear norequest flags */ |
538 | get_irq_desc(i)->status &= ~IRQ_NOREQUEST; | 540 | irq_to_desc(i)->status &= ~IRQ_NOREQUEST; |
539 | 541 | ||
540 | /* Legacy flags are left to default at this point, | 542 | /* Legacy flags are left to default at this point, |
541 | * one can then use irq_create_mapping() to | 543 | * one can then use irq_create_mapping() to |
@@ -602,7 +604,7 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq, | |||
602 | irq_hw_number_t hwirq) | 604 | irq_hw_number_t hwirq) |
603 | { | 605 | { |
604 | /* Clear IRQ_NOREQUEST flag */ | 606 | /* Clear IRQ_NOREQUEST flag */ |
605 | get_irq_desc(virq)->status &= ~IRQ_NOREQUEST; | 607 | irq_to_desc(virq)->status &= ~IRQ_NOREQUEST; |
606 | 608 | ||
607 | /* map it */ | 609 | /* map it */ |
608 | smp_wmb(); | 610 | smp_wmb(); |
@@ -732,7 +734,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller, | |||
732 | 734 | ||
733 | /* Set type if specified and different than the current one */ | 735 | /* Set type if specified and different than the current one */ |
734 | if (type != IRQ_TYPE_NONE && | 736 | if (type != IRQ_TYPE_NONE && |
735 | type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK)) | 737 | type != (irq_to_desc(virq)->status & IRQF_TRIGGER_MASK)) |
736 | set_irq_type(virq, type); | 738 | set_irq_type(virq, type); |
737 | return virq; | 739 | return virq; |
738 | } | 740 | } |
@@ -804,7 +806,7 @@ void irq_dispose_mapping(unsigned int virq) | |||
804 | irq_map[virq].hwirq = host->inval_irq; | 806 | irq_map[virq].hwirq = host->inval_irq; |
805 | 807 | ||
806 | /* Set some flags */ | 808 | /* Set some flags */ |
807 | get_irq_desc(virq)->status |= IRQ_NOREQUEST; | 809 | irq_to_desc(virq)->status |= IRQ_NOREQUEST; |
808 | 810 | ||
809 | /* Free it */ | 811 | /* Free it */ |
810 | irq_free_virt(virq, 1); | 812 | irq_free_virt(virq, 1); |
@@ -1001,7 +1003,7 @@ void irq_early_init(void) | |||
1001 | unsigned int i; | 1003 | unsigned int i; |
1002 | 1004 | ||
1003 | for (i = 0; i < NR_IRQS; i++) | 1005 | for (i = 0; i < NR_IRQS; i++) |
1004 | get_irq_desc(i)->status |= IRQ_NOREQUEST; | 1006 | irq_to_desc(i)->status |= IRQ_NOREQUEST; |
1005 | } | 1007 | } |
1006 | 1008 | ||
1007 | /* We need to create the radix trees late */ | 1009 | /* We need to create the radix trees late */ |
@@ -1064,7 +1066,7 @@ static int virq_debug_show(struct seq_file *m, void *private) | |||
1064 | "chip name", "host name"); | 1066 | "chip name", "host name"); |
1065 | 1067 | ||
1066 | for (i = 1; i < NR_IRQS; i++) { | 1068 | for (i = 1; i < NR_IRQS; i++) { |
1067 | desc = get_irq_desc(i); | 1069 | desc = irq_to_desc(i); |
1068 | spin_lock_irqsave(&desc->lock, flags); | 1070 | spin_lock_irqsave(&desc->lock, flags); |
1069 | 1071 | ||
1070 | if (desc->action && desc->action->handler) { | 1072 | if (desc->action && desc->action->handler) { |