aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/iosapic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-25 15:16:05 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-29 08:48:03 -0400
commitdea1078e1a67f3d877ef553e3189df20fcca54e0 (patch)
tree767ca9772429fa4b75a5005bc4c85a7c7e89ef92 /arch/ia64/kernel/iosapic.c
parente5ffece737378ddefb3412f76e8d2928915af3a1 (diff)
ia64: iosapic: Cleanup irq_desc access
Use irq_to_desc() and use accessors for setting chip and handler. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/ia64/kernel/iosapic.c')
-rw-r--r--arch/ia64/kernel/iosapic.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index e3954556eedb..858a995f3d3b 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -566,8 +566,7 @@ static int
566register_intr (unsigned int gsi, int irq, unsigned char delivery, 566register_intr (unsigned int gsi, int irq, unsigned char delivery,
567 unsigned long polarity, unsigned long trigger) 567 unsigned long polarity, unsigned long trigger)
568{ 568{
569 struct irq_desc *idesc; 569 struct irq_chip *chip, *irq_type;
570 struct irq_chip *irq_type;
571 int index; 570 int index;
572 struct iosapic_rte_info *rte; 571 struct iosapic_rte_info *rte;
573 572
@@ -614,19 +613,18 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
614 613
615 irq_type = iosapic_get_irq_chip(trigger); 614 irq_type = iosapic_get_irq_chip(trigger);
616 615
617 idesc = irq_desc + irq; 616 chip = irq_get_chip(irq);
618 if (irq_type != NULL && idesc->chip != irq_type) { 617 if (irq_type != NULL && chip != irq_type) {
619 if (idesc->chip != &no_irq_chip) 618 if (chip != &no_irq_chip)
620 printk(KERN_WARNING 619 printk(KERN_WARNING
621 "%s: changing vector %d from %s to %s\n", 620 "%s: changing vector %d from %s to %s\n",
622 __func__, irq_to_vector(irq), 621 __func__, irq_to_vector(irq),
623 idesc->chip->name, irq_type->name); 622 chip->name, irq_type->name);
624 idesc->chip = irq_type; 623 chip = irq_type;
625 } 624 }
626 if (trigger == IOSAPIC_EDGE) 625 __irq_set_chip_handler_name_locked(irq, chip, trigger == IOSAPIC_EDGE ?
627 __set_irq_handler_unlocked(irq, handle_edge_irq); 626 handle_edge_irq : handle_level_irq,
628 else 627 NULL);
629 __set_irq_handler_unlocked(irq, handle_level_irq);
630 return 0; 628 return 0;
631} 629}
632 630
@@ -736,6 +734,7 @@ iosapic_register_intr (unsigned int gsi,
736 struct iosapic_rte_info *rte; 734 struct iosapic_rte_info *rte;
737 u32 low32; 735 u32 low32;
738 unsigned char dmode; 736 unsigned char dmode;
737 struct irq_desc *desc;
739 738
740 /* 739 /*
741 * If this GSI has already been registered (i.e., it's a 740 * If this GSI has already been registered (i.e., it's a
@@ -763,12 +762,13 @@ iosapic_register_intr (unsigned int gsi,
763 goto unlock_iosapic_lock; 762 goto unlock_iosapic_lock;
764 } 763 }
765 764
766 raw_spin_lock(&irq_desc[irq].lock); 765 desc = irq_to_desc(irq);
766 raw_spin_lock(&desc->lock);
767 dest = get_target_cpu(gsi, irq); 767 dest = get_target_cpu(gsi, irq);
768 dmode = choose_dmode(); 768 dmode = choose_dmode();
769 err = register_intr(gsi, irq, dmode, polarity, trigger); 769 err = register_intr(gsi, irq, dmode, polarity, trigger);
770 if (err < 0) { 770 if (err < 0) {
771 raw_spin_unlock(&irq_desc[irq].lock); 771 raw_spin_unlock(&desc->lock);
772 irq = err; 772 irq = err;
773 goto unlock_iosapic_lock; 773 goto unlock_iosapic_lock;
774 } 774 }
@@ -787,7 +787,7 @@ iosapic_register_intr (unsigned int gsi,
787 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), 787 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
788 cpu_logical_id(dest), dest, irq_to_vector(irq)); 788 cpu_logical_id(dest), dest, irq_to_vector(irq));
789 789
790 raw_spin_unlock(&irq_desc[irq].lock); 790 raw_spin_unlock(&desc->lock);
791 unlock_iosapic_lock: 791 unlock_iosapic_lock:
792 spin_unlock_irqrestore(&iosapic_lock, flags); 792 spin_unlock_irqrestore(&iosapic_lock, flags);
793 return irq; 793 return irq;
@@ -798,7 +798,6 @@ iosapic_unregister_intr (unsigned int gsi)
798{ 798{
799 unsigned long flags; 799 unsigned long flags;
800 int irq, index; 800 int irq, index;
801 struct irq_desc *idesc;
802 u32 low32; 801 u32 low32;
803 unsigned long trigger, polarity; 802 unsigned long trigger, polarity;
804 unsigned int dest; 803 unsigned int dest;
@@ -828,7 +827,6 @@ iosapic_unregister_intr (unsigned int gsi)
828 if (--rte->refcnt > 0) 827 if (--rte->refcnt > 0)
829 goto out; 828 goto out;
830 829
831 idesc = irq_desc + irq;
832 rte->refcnt = NO_REF_RTE; 830 rte->refcnt = NO_REF_RTE;
833 831
834 /* Mask the interrupt */ 832 /* Mask the interrupt */
@@ -852,7 +850,7 @@ iosapic_unregister_intr (unsigned int gsi)
852 if (iosapic_intr_info[irq].count == 0) { 850 if (iosapic_intr_info[irq].count == 0) {
853#ifdef CONFIG_SMP 851#ifdef CONFIG_SMP
854 /* Clear affinity */ 852 /* Clear affinity */
855 cpumask_setall(idesc->affinity); 853 cpumask_setall(irq_get_irq_data(irq)->affinity);
856#endif 854#endif
857 /* Clear the interrupt information */ 855 /* Clear the interrupt information */
858 iosapic_intr_info[irq].dest = 0; 856 iosapic_intr_info[irq].dest = 0;