ARM: 6524/1: GIC irq desciptor bug fix

gic_set_cpu will directly use irq_desc[]. If CONFIG_SPARSE_IRQ is
enabled, there is no irq_desc[]. So we need use irq_to_desc(irq) to
get the descriptor for irq.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Chao Xie and committed by Russell King 87507500 a5542a0f

+7 -1
+7 -1
arch/arm/common/gic.c
··· 146 146 unsigned int shift = (irq % 4) * 8; 147 147 unsigned int cpu = cpumask_first(mask_val); 148 148 u32 val; 149 + struct irq_desc *desc; 149 150 150 151 spin_lock(&irq_controller_lock); 151 - irq_desc[irq].node = cpu; 152 + desc = irq_to_desc(irq); 153 + if (desc == NULL) { 154 + spin_unlock(&irq_controller_lock); 155 + return -EINVAL; 156 + } 157 + desc->node = cpu; 152 158 val = readl(reg) & ~(0xff << shift); 153 159 val |= 1 << (cpu + shift); 154 160 writel(val, reg);