[PATCH v3] mfd: kill off set_irq_flags usage

2015-07-27 Thread Rob Herring
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 r...@kernel.org
Cc: Samuel Ortiz sa...@linux.intel.com
Acked-by: Lee Jones lee.jo...@linaro.org
Acked-by: Linus Walleij linus.wall...@linaro.org
Cc: Milo Kim milo@ti.com
Cc: Kumar Gala ga...@codeaurora.org
Cc: Andy Gross agr...@codeaurora.org
Cc: David Brown dav...@codeaurora.org
Cc: Tony Lindgren t...@atomide.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: patc...@opensource.wolfsonmicro.com
Cc: linux-arm-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
Thomas asked that this be merged thru subsystem trees instead of arm-soc,
so please apply this to your tree.

Rob

 drivers/mfd/88pm860x-core.c |  4 
 drivers/mfd/ab8500-core.c   |  4 
 drivers/mfd/arizona-irq.c   |  7 ---
 drivers/mfd/asic3.c |  4 ++--
 drivers/mfd/db8500-prcmu.c  |  1 -
 drivers/mfd/ezx-pcap.c  |  6 +-
 drivers/mfd/htc-egpio.c |  4 ++--
 drivers/mfd/htc-i2cpld.c|  6 +-
 drivers/mfd/lp8788-irq.c|  5 -
 drivers/mfd/max8925-core.c  |  5 +
 drivers/mfd/max8997-irq.c   |  5 +
 drivers/mfd/max8998-irq.c   |  5 +
 drivers/mfd/mt6397-core.c   |  4 
 drivers/mfd/pm8921-core.c   |  5 +
 drivers/mfd/rc5t583-irq.c   |  4 +---
 drivers/mfd/stmpe.c |  7 ---
 drivers/mfd/t7l66xb.c   |  6 --
 drivers/mfd/tc3589x.c   |  7 ---
 drivers/mfd/tc6393xb.c  |  4 ++--
 drivers/mfd/tps6586x.c  |  7 ---
 drivers/mfd/tps65912-irq.c  |  8 +---
 drivers/mfd/twl4030-irq.c   | 11 +--
 drivers/mfd/twl6030-irq.c   | 13 -
 drivers/mfd/ucb1x00-core.c  |  2 +-
 drivers/mfd/wm831x-irq.c|  7 ---
 drivers/mfd/wm8350-irq.c|  8 +---
 drivers/mfd/wm8994-irq.c|  7 ---
 27 files changed, 17 insertions(+), 139 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index e03b7f4..bc0f3c0 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -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;
 }

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 000da72..fefbe4c 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -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;
 }
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index 2b9965d5..7d66aec 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -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;
 }
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 120df5c..4b54128 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -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);
+   

Re: [PATCH v3] mfd: kill off set_irq_flags usage

2015-07-27 Thread Lee Jones
On Mon, 27 Jul 2015, Rob Herring wrote:

 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 r...@kernel.org
 Cc: Samuel Ortiz sa...@linux.intel.com
 Acked-by: Lee Jones lee.jo...@linaro.org
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Cc: Milo Kim milo@ti.com
 Cc: Kumar Gala ga...@codeaurora.org
 Cc: Andy Gross agr...@codeaurora.org
 Cc: David Brown dav...@codeaurora.org
 Cc: Tony Lindgren t...@atomide.com
 Cc: linux-arm-ker...@lists.infradead.org
 Cc: patc...@opensource.wolfsonmicro.com
 Cc: linux-arm-...@vger.kernel.org
 Cc: linux-...@vger.kernel.org
 Cc: linux-omap@vger.kernel.org
 ---
 Thomas asked that this be merged thru subsystem trees instead of arm-soc,
 so please apply this to your tree.
 
 Rob
 
  drivers/mfd/88pm860x-core.c |  4 
  drivers/mfd/ab8500-core.c   |  4 
  drivers/mfd/arizona-irq.c   |  7 ---
  drivers/mfd/asic3.c |  4 ++--
  drivers/mfd/db8500-prcmu.c  |  1 -
  drivers/mfd/ezx-pcap.c  |  6 +-
  drivers/mfd/htc-egpio.c |  4 ++--
  drivers/mfd/htc-i2cpld.c|  6 +-
  drivers/mfd/lp8788-irq.c|  5 -
  drivers/mfd/max8925-core.c  |  5 +
  drivers/mfd/max8997-irq.c   |  5 +
  drivers/mfd/max8998-irq.c   |  5 +
  drivers/mfd/mt6397-core.c   |  4 
  drivers/mfd/pm8921-core.c   |  5 +
  drivers/mfd/rc5t583-irq.c   |  4 +---
  drivers/mfd/stmpe.c |  7 ---
  drivers/mfd/t7l66xb.c   |  6 --
  drivers/mfd/tc3589x.c   |  7 ---
  drivers/mfd/tc6393xb.c  |  4 ++--
  drivers/mfd/tps6586x.c  |  7 ---
  drivers/mfd/tps65912-irq.c  |  8 +---
  drivers/mfd/twl4030-irq.c   | 11 +--
  drivers/mfd/twl6030-irq.c   | 13 -
  drivers/mfd/ucb1x00-core.c  |  2 +-
  drivers/mfd/wm831x-irq.c|  7 ---
  drivers/mfd/wm8350-irq.c|  8 +---
  drivers/mfd/wm8994-irq.c|  7 ---
  27 files changed, 17 insertions(+), 139 deletions(-)

Applied, thanks.

 diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
 index e03b7f4..bc0f3c0 100644
 --- a/drivers/mfd/88pm860x-core.c
 +++ b/drivers/mfd/88pm860x-core.c
 @@ -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;
  }
 
 diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
 index 000da72..fefbe4c 100644
 --- a/drivers/mfd/ab8500-core.c
 +++ b/drivers/mfd/ab8500-core.c
 @@ -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;
  }
 diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
 index 2b9965d5..7d66aec 100644
 --- a/drivers/mfd/arizona-irq.c
 +++ b/drivers/mfd/arizona-irq.c
 @@ -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;
  }
 diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
 index 120df5c..4b54128 100644
 --- a/drivers/mfd/asic3.c
 +++ b/drivers/mfd/asic3.c
 @@ -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 =