Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[muen/linux.git] / kernel / irq / manage.c
index a66c58f91bff5582c3b36e577b11a15ffc86ae52..fb86146037a745e85a862771f437866d9ab31707 100644 (file)
@@ -1072,6 +1072,13 @@ static int irq_setup_forced_threading(struct irqaction *new)
        if (new->flags & (IRQF_NO_THREAD | IRQF_PERCPU | IRQF_ONESHOT))
                return 0;
 
+       /*
+        * No further action required for interrupts which are requested as
+        * threaded interrupts already
+        */
+       if (new->handler == irq_default_primary_handler)
+               return 0;
+
        new->flags |= IRQF_ONESHOT;
 
        /*
@@ -1079,7 +1086,7 @@ static int irq_setup_forced_threading(struct irqaction *new)
         * thread handler. We force thread them as well by creating a
         * secondary action.
         */
-       if (new->handler != irq_default_primary_handler && new->thread_fn) {
+       if (new->handler && new->thread_fn) {
                /* Allocate the secondary action */
                new->secondary = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
                if (!new->secondary)