genirq: Consolidate startup/shutdown of interrupts
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / irq / manage.c
index 30bc8de409056527dc19bdeba6b1c5ea40830ac7..9c562477e28b5a3790abbe9ecf8edce74fae0be7 100644 (file)
@@ -906,11 +906,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
                if (new->flags & IRQF_ONESHOT)
                        desc->status |= IRQ_ONESHOT;
 
-               if (!(desc->status & IRQ_NOAUTOEN)) {
-                       desc->depth = 0;
-                       desc->status &= ~IRQ_DISABLED;
-                       desc->irq_data.chip->irq_startup(&desc->irq_data);
-               } else
+               if (!(desc->status & IRQ_NOAUTOEN))
+                       irq_startup(desc);
+               else
                        /* Undo nested disables: */
                        desc->depth = 1;
 
@@ -1055,10 +1053,8 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
 #endif
 
        /* If this was the last handler, shut down the IRQ line: */
-       if (!desc->action) {
-               desc->status |= IRQ_DISABLED;
-               desc->irq_data.chip->irq_shutdown(&desc->irq_data);
-       }
+       if (!desc->action)
+               irq_shutdown(desc);
 
 #ifdef CONFIG_SMP
        /* make sure affinity_hint is cleaned up */