[RFC/RFT,1/3] gpio: tegra: remove gpio_to_irq() from hw irq handlers

Message ID 20170708224413.18281-2-grygorii.strashko@ti.com
State New
Headers show

Commit Message

Grygorii Strashko July 8, 2017, 10:44 p.m.
gpio_to_irq() API expected to be used by GPIO consumers and
not drivers and there are no guarantee that its gpiolib implementation
is irq safe.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/gpio/gpio-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij Aug. 1, 2017, 7:49 a.m. | #1
On Sun, Jul 9, 2017 at 12:44 AM, Grygorii Strashko
<grygorii.strashko@ti.com> wrote:

> gpio_to_irq() API expected to be used by GPIO consumers and
> not drivers and there are no guarantee that its gpiolib implementation
> is irq safe.
>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Patch applied.

This is obviously the right way to do it.

Tegra people: please test.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 88529d3..31b9a86 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -389,7 +389,8 @@  static void tegra_gpio_irq_handler(struct irq_desc *desc)
 				chained_irq_exit(chip, desc);
 			}
 
-			generic_handle_irq(gpio_to_irq(gpio + pin));
+			generic_handle_irq(irq_find_mapping(tgi->irq_domain,
+							    gpio + pin));
 		}
 	}