Merge tag 'platform-drivers-x86-v3.20-1' of git://git.infradead.org/users/dvhart...
[firefly-linux-kernel-4.4.55.git] / drivers / irqchip / irq-hip04.c
index 6bc2deb73d533b3a226f66c2ef17ed2aa3eaf3bb..7d6ffb5de84fce346ebd89c63c4a7a5fbb74e714 100644 (file)
@@ -120,21 +120,24 @@ static int hip04_irq_set_type(struct irq_data *d, unsigned int type)
 {
        void __iomem *base = hip04_dist_base(d);
        unsigned int irq = hip04_irq(d);
+       int ret;
 
        /* Interrupt configuration for SGIs can't be changed */
        if (irq < 16)
                return -EINVAL;
 
-       if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
+       /* SPIs have restrictions on the supported types */
+       if (irq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
+                        type != IRQ_TYPE_EDGE_RISING)
                return -EINVAL;
 
        raw_spin_lock(&irq_controller_lock);
 
-       gic_configure_irq(irq, type, base, NULL);
+       ret = gic_configure_irq(irq, type, base, NULL);
 
        raw_spin_unlock(&irq_controller_lock);
 
-       return 0;
+       return ret;
 }
 
 #ifdef CONFIG_SMP