]> git.karo-electronics.de Git - linux-beck.git/commitdiff
genirq: Reuse existing can set affinty check
authorThomas Gleixner <tglx@linutronix.de>
Thu, 10 Feb 2011 21:37:41 +0000 (22:37 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Feb 2011 11:58:20 +0000 (12:58 +0100)
Add a !desc check while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/manage.c
kernel/irq/proc.c

index 84a0a9c22226dc339f5d2d7e0803c7c340f6af35..550ae97a004078843c4624dcfd0f289ef8bde999 100644 (file)
@@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq)
 {
        struct irq_desc *desc = irq_to_desc(irq);
 
-       if (!irqd_can_balance(&desc->irq_data) || !desc->irq_data.chip ||
-           !desc->irq_data.chip->irq_set_affinity)
+       if (!desc || !irqd_can_balance(&desc->irq_data) ||
+           !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity)
                return 0;
 
        return 1;
index afe4e68031483bc9e7fcc91ccf9f486273ef1965..4cc2e5ed0bec2e1228f741af005d581808a6c13a 100644 (file)
@@ -66,8 +66,7 @@ static ssize_t irq_affinity_proc_write(struct file *file,
        cpumask_var_t new_value;
        int err;
 
-       if (!irq_to_desc(irq)->irq_data.chip->irq_set_affinity || no_irq_affinity ||
-           irq_balancing_disabled(irq))
+       if (!irq_can_set_affinity(irq) || no_irq_affinity)
                return -EIO;
 
        if (!alloc_cpumask_var(&new_value, GFP_KERNEL))