mfd: Kill off set_irq_flags usage
authorRob Herring <robh@kernel.org>
Mon, 27 Jul 2015 20:55:20 +0000 (15:55 -0500)
committerLee Jones <lee.jones@linaro.org>
Tue, 11 Aug 2015 14:09:01 +0000 (15:09 +0100)
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
27 files changed:
drivers/mfd/88pm860x-core.c
drivers/mfd/ab8500-core.c
drivers/mfd/arizona-irq.c
drivers/mfd/asic3.c
drivers/mfd/db8500-prcmu.c
drivers/mfd/ezx-pcap.c
drivers/mfd/htc-egpio.c
drivers/mfd/htc-i2cpld.c
drivers/mfd/lp8788-irq.c
drivers/mfd/max8925-core.c
drivers/mfd/max8997-irq.c
drivers/mfd/max8998-irq.c
drivers/mfd/mt6397-core.c
drivers/mfd/pm8921-core.c
drivers/mfd/rc5t583-irq.c
drivers/mfd/stmpe.c
drivers/mfd/t7l66xb.c
drivers/mfd/tc3589x.c
drivers/mfd/tc6393xb.c
drivers/mfd/tps6586x.c
drivers/mfd/tps65912-irq.c
drivers/mfd/twl4030-irq.c
drivers/mfd/twl6030-irq.c
drivers/mfd/ucb1x00-core.c
drivers/mfd/wm831x-irq.c
drivers/mfd/wm8350-irq.c
drivers/mfd/wm8994-irq.c

index cb47d6e00ebec5be2497c21b651e29d737f6832e..3269a9990b2422cfa05de0aa30dd163fc1b5f397 100644 (file)
@@ -558,11 +558,7 @@ static int pm860x_irq_domain_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_data(virq, d->host_data);
        irq_set_chip_and_handler(virq, &pm860x_irq_chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
        return 0;
 }
 
index 000da72a0ae962f0f5f0132571a4fe9626b4fda7..fefbe4cfa61ddb8721c94e7a30c861dcf66cd7be 100644 (file)
@@ -565,11 +565,7 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_and_handler(virq, &ab8500_irq_chip,
                                handle_simple_irq);
        irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
index bb0063db6c4ed161f26cdfddc57c10ed7acb9a4b..2cac4f463f1e679fca4cbd95ec03b5e461b590d2 100644 (file)
@@ -174,14 +174,7 @@ static int arizona_irq_map(struct irq_domain *h, unsigned int virq,
        irq_set_chip_data(virq, data);
        irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq);
        irq_set_nested_thread(virq, 1);
-
-       /* ARM needs us to explicitly flag the IRQ as valid
-        * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
index 120df5c08741a1b0f2fe53ca592fae2d7fd94ee2..4b54128bc78ed35f07c6d974a4aa420ff5377699 100644 (file)
@@ -411,7 +411,7 @@ static int __init asic3_irq_probe(struct platform_device *pdev)
 
                irq_set_chip_data(irq, asic);
                irq_set_handler(irq, handle_level_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK),
@@ -431,7 +431,7 @@ static void asic3_irq_remove(struct platform_device *pdev)
        irq_base = asic->irq_base;
 
        for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) {
-               set_irq_flags(irq, 0);
+               irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
                irq_set_chip_and_handler(irq, NULL, NULL);
                irq_set_chip_data(irq, NULL);
        }
index 8b14740f9fca878c870a89f9588a51ae67cd14ed..e6e4bacb09ee5d2636576c3363c97a1a5c5f72c8 100644 (file)
@@ -2654,7 +2654,6 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
 {
        irq_set_chip_and_handler(virq, &prcmu_irq_chip,
                                handle_simple_irq);
-       set_irq_flags(virq, IRQF_VALID);
 
        return 0;
 }
index 5991faddd3c633aa990cc5e72a015787bea60a4d..19e55dd97a4e389029449ce1c440ecc6c9e14e89 100644 (file)
@@ -463,11 +463,7 @@ static int ezx_pcap_probe(struct spi_device *spi)
        for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) {
                irq_set_chip_and_handler(i, &pcap_irq_chip, handle_simple_irq);
                irq_set_chip_data(i, pcap);
-#ifdef CONFIG_ARM
-               set_irq_flags(i, IRQF_VALID);
-#else
-               irq_set_noprobe(i);
-#endif
+               irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        /* mask/ack all PCAP interrupts */
index 49f39feca7843e73bce9e906953ed5620936a193..c9d5e3fb4fd18a9b1cc06f9d3663f0dde6b58ea4 100644 (file)
@@ -350,7 +350,7 @@ static int __init egpio_probe(struct platform_device *pdev)
                        irq_set_chip_and_handler(irq, &egpio_muxed_chip,
                                                 handle_simple_irq);
                        irq_set_chip_data(irq, ei);
-                       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+                       irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
                }
                irq_set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING);
                irq_set_handler_data(ei->chained_irq, ei);
@@ -376,7 +376,7 @@ static int __exit egpio_remove(struct platform_device *pdev)
                irq_end = ei->irq_start + ei->nirqs;
                for (irq = ei->irq_start; irq < irq_end; irq++) {
                        irq_set_chip_and_handler(irq, NULL, NULL);
-                       set_irq_flags(irq, 0);
+                       irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
                }
                irq_set_chained_handler(ei->chained_irq, NULL);
                device_init_wakeup(&pdev->dev, 0);
index b54baad3016456114da059f59375ea94a4177999..1bd5b042c8b33b363845eb49ce5e0e161b402601 100644 (file)
@@ -330,11 +330,7 @@ static int htcpld_setup_chip_irq(
                irq_set_chip_and_handler(irq, &htcpld_muxed_chip,
                                         handle_simple_irq);
                irq_set_chip_data(irq, chip);
-#ifdef CONFIG_ARM
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-#else
-               irq_set_probe(irq);
-#endif
+               irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        return ret;
index a87f2b548f7120e48cb5235452ea5d1cca01df96..c7a9825aa4ce42a8f358834b529657374e2a47b8 100644 (file)
@@ -141,12 +141,7 @@ static int lp8788_irq_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_data(virq, irqd);
        irq_set_chip_and_handler(virq, chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
index 8520bd68c1ff9451f901c7b43f16340900025635..fd8b15cd84fdf4a7748f7947f2f850272fbcd8c7 100644 (file)
@@ -650,11 +650,8 @@ static int max8925_irq_domain_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_data(virq, d->host_data);
        irq_set_chip_and_handler(virq, &max8925_irq_chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
+
        return 0;
 }
 
index d3025be57f3937d1482d1ac5429229cec8624d1b..684d901881dc5e8c60153541dadc752caaa3f4d4 100644 (file)
@@ -295,11 +295,8 @@ static int max8997_irq_domain_map(struct irq_domain *d, unsigned int irq,
        irq_set_chip_data(irq, max8997);
        irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq);
        irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(irq, IRQF_VALID);
-#else
        irq_set_noprobe(irq);
-#endif
+
        return 0;
 }
 
index 3702056628a84abc0b42e7487baffc366b8b32e4..35a077477ce2dc06346a3e6f7f89fe515600b012 100644 (file)
@@ -206,11 +206,8 @@ static int max8998_irq_domain_map(struct irq_domain *d, unsigned int irq,
        irq_set_chip_data(irq, max8998);
        irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq);
        irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(irq, IRQF_VALID);
-#else
        irq_set_noprobe(irq);
-#endif
+
        return 0;
 }
 
index 03929a6c6fc494bf04c71a3140d7d88630769495..665d5e136b2d0de2159ea3ced73b35dc12e04dda 100644 (file)
@@ -142,11 +142,7 @@ static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq,
        irq_set_chip_data(irq, mt6397);
        irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq);
        irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(irq, IRQF_VALID);
-#else
        irq_set_noprobe(irq);
-#endif
 
        return 0;
 }
index 00856a67d34b3032a7f527994efda665b27671d7..24396d71a26217c8df72762ff27b65e332db9fe2 100644 (file)
@@ -289,11 +289,8 @@ static int pm8xxx_irq_domain_map(struct irq_domain *d, unsigned int irq,
 
        irq_set_chip_and_handler(irq, &pm8xxx_irq_chip, handle_level_irq);
        irq_set_chip_data(irq, chip);
-#ifdef CONFIG_ARM
-       set_irq_flags(irq, IRQF_VALID);
-#else
        irq_set_noprobe(irq);
-#endif
+
        return 0;
 }
 
index bb85020202741d9328add483133fc212eeaa621c..3f8812daa3045e89e67df777a17b38817800315b 100644 (file)
@@ -386,9 +386,7 @@ int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base)
                irq_set_chip_and_handler(__irq, &rc5t583_irq_chip,
                                         handle_simple_irq);
                irq_set_nested_thread(__irq, 1);
-#ifdef CONFIG_ARM
-               set_irq_flags(__irq, IRQF_VALID);
-#endif
+               irq_clear_status_flags(__irq, IRQ_NOREQUEST);
        }
 
        ret = request_threaded_irq(irq, NULL, rc5t583_irq, IRQF_ONESHOT,
index 18c4d72d1d2a93b50a049c28d838eacc80ba7dd1..e971af86ce1ef7e495d47364aeee15f5c10b76a1 100644 (file)
@@ -971,20 +971,13 @@ static int stmpe_irq_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_data(virq, stmpe);
        irq_set_chip_and_handler(virq, chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
 
 static void stmpe_irq_unmap(struct irq_domain *d, unsigned int virq)
 {
-#ifdef CONFIG_ARM
-               set_irq_flags(virq, 0);
-#endif
                irq_set_chip_and_handler(virq, NULL, NULL);
                irq_set_chip_data(virq, NULL);
 }
index 854b05f840bbbeb03b6f1c30906a62bb97d00a3d..96d82980ead407345de76199cd1a8112d7566315 100644 (file)
@@ -246,9 +246,6 @@ static void t7l66xb_attach_irq(struct platform_device *dev)
        for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
                irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq);
                irq_set_chip_data(irq, t7l66xb);
-#ifdef CONFIG_ARM
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-#endif
        }
 
        irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING);
@@ -267,9 +264,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
        irq_set_handler_data(t7l66xb->irq, NULL);
 
        for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) {
-#ifdef CONFIG_ARM
-               set_irq_flags(irq, 0);
-#endif
                irq_set_chip(irq, NULL);
                irq_set_chip_data(irq, NULL);
        }
index 27e157908ce0fb695d2408fbb2d5006dfb30389b..274bf39968aaa1a9c9527fe0093cc7790d05f1f6 100644 (file)
@@ -215,20 +215,13 @@ static int tc3589x_irq_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_and_handler(virq, &dummy_irq_chip,
                                handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
 
 static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq)
 {
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, 0);
-#endif
        irq_set_chip_and_handler(virq, NULL, NULL);
        irq_set_chip_data(virq, NULL);
 }
index 63458b39a97d7ae177be77168a630944656a4a08..c108472e5163311fae157ce9b49c0a809410b42c 100644 (file)
@@ -586,7 +586,7 @@ static void tc6393xb_attach_irq(struct platform_device *dev)
        for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
                irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq);
                irq_set_chip_data(irq, tc6393xb);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING);
@@ -605,7 +605,7 @@ static void tc6393xb_detach_irq(struct platform_device *dev)
        irq_base = tc6393xb->irq_base;
 
        for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) {
-               set_irq_flags(irq, 0);
+               irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
                irq_set_chip(irq, NULL);
                irq_set_chip_data(irq, NULL);
        }
index 4a87c1fe34954b654721179f3ade28037a84c361..5628a6b5b19becfb28e060de827cbfaef2c6a19d 100644 (file)
@@ -299,14 +299,7 @@ static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,
        irq_set_chip_data(virq, tps6586x);
        irq_set_chip_and_handler(virq, &tps6586x_irq_chip, handle_simple_irq);
        irq_set_nested_thread(virq, 1);
-
-       /* ARM needs us to explicitly flag the IRQ as valid
-        * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
index fbecec7f1e3df9f6d3a375714fe741d341bdb43f..db2c29cb709bdfbcb419862d95bef2b2454eef6a 100644 (file)
@@ -197,13 +197,7 @@ int tps65912_irq_init(struct tps65912 *tps65912, int irq,
                irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip,
                                         handle_edge_irq);
                irq_set_nested_thread(cur_irq, 1);
-               /* ARM needs us to explicitly flag the IRQ as valid
-                * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-               set_irq_flags(cur_irq, IRQF_VALID);
-#else
-               irq_set_noprobe(cur_irq);
-#endif
+               irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        ret = request_threaded_irq(irq, NULL, tps65912_irq, flags,
index a3fa7f4f1fb4d8ca142e2a22d4081c8494c37cab..40e51b0baa46b57ec10a2ec0893ca0d6d1c82884 100644 (file)
@@ -419,16 +419,7 @@ static int twl4030_init_sih_modules(unsigned line)
 
 static inline void activate_irq(int irq)
 {
-#ifdef CONFIG_ARM
-       /*
-        * ARM requires an extra step to clear IRQ_NOREQUEST, which it
-        * sets on behalf of every irq_chip.  Also sets IRQ_NOPROBE.
-        */
-       set_irq_flags(irq, IRQF_VALID);
-#else
-       /* same effect on other architectures */
-       irq_set_noprobe(irq);
-#endif
+       irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE);
 }
 
 /*----------------------------------------------------------------------*/
index 20fb58179adad3d3df48ea15123bbacea97bdd83..c1bb62473436ffb45d9431a417501cdb5dd8a07f 100644 (file)
@@ -352,26 +352,13 @@ static int twl6030_irq_map(struct irq_domain *d, unsigned int virq,
        irq_set_chip_and_handler(virq,  &pdata->irq_chip, handle_simple_irq);
        irq_set_nested_thread(virq, true);
        irq_set_parent(virq, pdata->twl_irq);
-
-#ifdef CONFIG_ARM
-       /*
-        * ARM requires an extra step to clear IRQ_NOREQUEST, which it
-        * sets on behalf of every irq_chip.  Also sets IRQ_NOPROBE.
-        */
-       set_irq_flags(virq, IRQF_VALID);
-#else
-       /* same effect on other architectures */
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
 
 static void twl6030_irq_unmap(struct irq_domain *d, unsigned int virq)
 {
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, 0);
-#endif
        irq_set_chip_and_handler(virq, NULL, NULL);
        irq_set_chip_data(virq, NULL);
 }
index 3591550598ad494f0f5c48db7f685a4ae97ed1dc..616f5e4fbdc3521a3420fccc8f4c15545bb45b28 100644 (file)
@@ -562,7 +562,7 @@ static int ucb1x00_probe(struct mcp *mcp)
 
                irq_set_chip_and_handler(irq, &ucb1x00_irqchip, handle_edge_irq);
                irq_set_chip_data(irq, ucb);
-               set_irq_flags(irq, IRQF_VALID | IRQ_NOREQUEST);
+               irq_clear_status_flags(irq, IRQ_NOREQUEST);
        }
 
        irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING);
index 3da81263c764ad13afebfcd355c8630ff1c3f45d..dfea8b9c2fe6bb326d1bc9e97f78010121965e48 100644 (file)
@@ -552,14 +552,7 @@ static int wm831x_irq_map(struct irq_domain *h, unsigned int virq,
        irq_set_chip_data(virq, h->host_data);
        irq_set_chip_and_handler(virq, &wm831x_irq_chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-
-       /* ARM needs us to explicitly flag the IRQ as valid
-        * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }
index 813ff50f95b699a3ee7784f3f12374f24efbca6c..27054f357b8e565c2afa07cb6845465c61cef944 100644 (file)
@@ -526,13 +526,7 @@ int wm8350_irq_init(struct wm8350 *wm8350, int irq,
                                         handle_edge_irq);
                irq_set_nested_thread(cur_irq, 1);
 
-               /* ARM needs us to explicitly flag the IRQ as valid
-                * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-               set_irq_flags(cur_irq, IRQF_VALID);
-#else
-               irq_set_noprobe(cur_irq);
-#endif
+               irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE);
        }
 
        ret = request_threaded_irq(irq, NULL, wm8350_irq, flags,
index 55c380a676861208dc355a9e66fda859e9cc15bd..6f1427d32a93db9406f7c0cbd878f1bc726804cc 100644 (file)
@@ -172,14 +172,7 @@ static int wm8994_edge_irq_map(struct irq_domain *h, unsigned int virq,
        irq_set_chip_data(virq, wm8994);
        irq_set_chip_and_handler(virq, &wm8994_edge_irq_chip, handle_edge_irq);
        irq_set_nested_thread(virq, 1);
-
-       /* ARM needs us to explicitly flag the IRQ as valid
-        * and will set them noprobe when we do so. */
-#ifdef CONFIG_ARM
-       set_irq_flags(virq, IRQF_VALID);
-#else
        irq_set_noprobe(virq);
-#endif
 
        return 0;
 }