Commit bce43032 authored by Thomas Gleixner's avatar Thomas Gleixner

genirq: Reuse existing can set affinty check

Add a !desc check while at it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent a005677b
...@@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq) ...@@ -73,8 +73,8 @@ int irq_can_set_affinity(unsigned int irq)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc = irq_to_desc(irq);
if (!irqd_can_balance(&desc->irq_data) || !desc->irq_data.chip || if (!desc || !irqd_can_balance(&desc->irq_data) ||
!desc->irq_data.chip->irq_set_affinity) !desc->irq_data.chip || !desc->irq_data.chip->irq_set_affinity)
return 0; return 0;
return 1; return 1;
......
...@@ -66,8 +66,7 @@ static ssize_t irq_affinity_proc_write(struct file *file, ...@@ -66,8 +66,7 @@ static ssize_t irq_affinity_proc_write(struct file *file,
cpumask_var_t new_value; cpumask_var_t new_value;
int err; int err;
if (!irq_to_desc(irq)->irq_data.chip->irq_set_affinity || no_irq_affinity || if (!irq_can_set_affinity(irq) || no_irq_affinity)
irq_balancing_disabled(irq))
return -EIO; return -EIO;
if (!alloc_cpumask_var(&new_value, GFP_KERNEL)) if (!alloc_cpumask_var(&new_value, GFP_KERNEL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment