diff options
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r-- | drivers/irqchip/irq-gic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index d617ee5a3d8a..4634cf7d0ec3 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -188,12 +188,15 @@ static int gic_set_type(struct irq_data *d, unsigned int type) | |||
188 | { | 188 | { |
189 | void __iomem *base = gic_dist_base(d); | 189 | void __iomem *base = gic_dist_base(d); |
190 | unsigned int gicirq = gic_irq(d); | 190 | unsigned int gicirq = gic_irq(d); |
191 | int ret; | ||
191 | 192 | ||
192 | /* Interrupt configuration for SGIs can't be changed */ | 193 | /* Interrupt configuration for SGIs can't be changed */ |
193 | if (gicirq < 16) | 194 | if (gicirq < 16) |
194 | return -EINVAL; | 195 | return -EINVAL; |
195 | 196 | ||
196 | if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING) | 197 | /* SPIs have restrictions on the supported types */ |
198 | if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH && | ||
199 | type != IRQ_TYPE_EDGE_RISING) | ||
197 | return -EINVAL; | 200 | return -EINVAL; |
198 | 201 | ||
199 | raw_spin_lock(&irq_controller_lock); | 202 | raw_spin_lock(&irq_controller_lock); |
@@ -201,11 +204,11 @@ static int gic_set_type(struct irq_data *d, unsigned int type) | |||
201 | if (gic_arch_extn.irq_set_type) | 204 | if (gic_arch_extn.irq_set_type) |
202 | gic_arch_extn.irq_set_type(d, type); | 205 | gic_arch_extn.irq_set_type(d, type); |
203 | 206 | ||
204 | gic_configure_irq(gicirq, type, base, NULL); | 207 | ret = gic_configure_irq(gicirq, type, base, NULL); |
205 | 208 | ||
206 | raw_spin_unlock(&irq_controller_lock); | 209 | raw_spin_unlock(&irq_controller_lock); |
207 | 210 | ||
208 | return 0; | 211 | return ret; |
209 | } | 212 | } |
210 | 213 | ||
211 | static int gic_retrigger(struct irq_data *d) | 214 | static int gic_retrigger(struct irq_data *d) |