metag: Use irq_set_affinity instead of homebrewn code
authorThomas Gleixner <tglx@linutronix.de>
Sun, 23 Feb 2014 21:40:11 +0000 (21:40 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Mon, 17 Mar 2014 12:34:59 +0000 (12:34 +0000)
There is no point in having an incomplete copy of irq_set_affinity()
for the hotplug irq migration code.

Use the core function instead and while at it switch to
for_each_active_irq()

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: metag <linux-metag@vger.kernel.org>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
arch/metag/kernel/irq.c

index 3b4b7f6c0950ef89d975dc4c1e1845333a6d0fe9..5385dd1216b7ce5788093718e5e169c6a1d0906b 100644 (file)
@@ -261,18 +261,6 @@ int __init arch_probe_nr_irqs(void)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
-{
-       struct irq_desc *desc = irq_to_desc(irq);
-       struct irq_chip *chip = irq_data_get_irq_chip(data);
-       unsigned long flags;
-
-       raw_spin_lock_irqsave(&desc->lock, flags);
-       if (chip->irq_set_affinity)
-               chip->irq_set_affinity(data, cpumask_of(cpu), false);
-       raw_spin_unlock_irqrestore(&desc->lock, flags);
-}
-
 /*
  * The CPU has been marked offline.  Migrate IRQs off this CPU.  If
  * the affinity settings do not allow other CPUs, force them onto any
@@ -281,10 +269,9 @@ static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
 void migrate_irqs(void)
 {
        unsigned int i, cpu = smp_processor_id();
-       struct irq_desc *desc;
 
-       for_each_irq_desc(i, desc) {
-               struct irq_data *data = irq_desc_get_irq_data(desc);
+       for_each_active_irq(i) {
+               struct irq_data *data = irq_get_irq_data(i);
                unsigned int newcpu;
 
                if (irqd_is_per_cpu(data))
@@ -300,11 +287,8 @@ void migrate_irqs(void)
                                            i, cpu);
 
                        cpumask_setall(data->affinity);
-                       newcpu = cpumask_any_and(data->affinity,
-                                                cpu_online_mask);
                }
-
-               route_irq(data, i, newcpu);
+               irq_set_affinity(i, data->affinity);
        }
 }
 #endif /* CONFIG_HOTPLUG_CPU */