]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/xen/events.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / xen / events.c
index 2924faa7f6c4c08fdbea987a7135a6f689fcc993..add640ff5c6c873c6b43383b096ac947c6eab02f 100644 (file)
@@ -233,6 +233,7 @@ static void unmask_evtchn(int port)
 static int find_unbound_irq(void)
 {
        int irq;
+       struct irq_desc *desc;
 
        /* Only allocate from dynirq range */
        for (irq = 0; irq < nr_irqs; irq++)
@@ -242,6 +243,10 @@ static int find_unbound_irq(void)
        if (irq == nr_irqs)
                panic("No available IRQ to bind to: increase nr_irqs!\n");
 
+       desc = irq_to_desc_alloc_cpu(irq, 0);
+       if (WARN_ON(desc == NULL))
+               return -1;
+
        return irq;
 }
 
@@ -583,7 +588,7 @@ void rebind_evtchn_irq(int evtchn, int irq)
        spin_unlock(&irq_mapping_update_lock);
 
        /* new event channels are always bound to cpu 0 */
-       irq_set_affinity(irq, cpumask_of_cpu(0));
+       irq_set_affinity(irq, cpumask_of(0));
 
        /* Unmask the event channel. */
        enable_irq(irq);
@@ -612,9 +617,9 @@ static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
 }
 
 
-static void set_affinity_irq(unsigned irq, cpumask_t dest)
+static void set_affinity_irq(unsigned irq, const struct cpumask *dest)
 {
-       unsigned tcpu = first_cpu(dest);
+       unsigned tcpu = cpumask_first(dest);
        rebind_irq_to_cpu(irq, tcpu);
 }