Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pxa: remove gpio_to_irq() from hw irq handlers

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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Grygorii Strashko and committed by
Linus Walleij
64fcf3b3 dc749a09

+5 -3
+5 -3
drivers/gpio/gpio-pxa.c
··· 451 451 for_each_set_bit(n, &gedr, BITS_PER_LONG) { 452 452 loop = 1; 453 453 454 - generic_handle_irq(gpio_to_irq(gpio + n)); 454 + generic_handle_irq( 455 + irq_find_mapping(pchip->irqdomain, 456 + gpio + n)); 455 457 } 456 458 } 457 459 handled += loop; ··· 467 465 struct pxa_gpio_chip *pchip = d; 468 466 469 467 if (in_irq == pchip->irq0) { 470 - generic_handle_irq(gpio_to_irq(0)); 468 + generic_handle_irq(irq_find_mapping(pchip->irqdomain, 0)); 471 469 } else if (in_irq == pchip->irq1) { 472 - generic_handle_irq(gpio_to_irq(1)); 470 + generic_handle_irq(irq_find_mapping(pchip->irqdomain, 1)); 473 471 } else { 474 472 pr_err("%s() unknown irq %d\n", __func__, in_irq); 475 473 return IRQ_NONE;