[PATCH v2] gpiolib: Fix logic for driver override

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix incorrect logic in gpiochip_irqchip_add_key().
A driver needs to override both irq_request_resources and
irq_release_resources, otherwise gpiochip_irq_reqres and
gpiochip_irq_relres should be used.

Changed v1 -> v2:
  Correct repeated irq_request_resources in commit message

Signed-off-by: Chris Lesiak <chris.lesiak@xxxxxxxxx>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bdd68ff197dc..3e441879fea7 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1831,7 +1831,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
 	 * It is possible for a driver to override this, but only if the
 	 * alternative functions are both implemented.
 	 */
-	if (!irqchip->irq_request_resources &&
+	if (!irqchip->irq_request_resources ||
 	    !irqchip->irq_release_resources) {
 		irqchip->irq_request_resources = gpiochip_irq_reqres;
 		irqchip->irq_release_resources = gpiochip_irq_relres;
-- 
2.14.3

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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux