linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: don't override irq_*_resources() callbacks
@ 2015-07-31 12:48 Rabin Vincent
  2015-07-31 12:48 ` [PATCH 2/2] gpio: etraxfs: add interrupt support Rabin Vincent
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rabin Vincent @ 2015-07-31 12:48 UTC (permalink / raw)
  To: linus.walleij, gnurou; +Cc: linux-gpio, linux-kernel, Rabin Vincent

If the driver has specified its own irq_{request/release}_resources()
functions, don't override them.  The gpio-etraxfs driver will use this.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 drivers/gpio/gpiolib.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bf4bd1d..6865874 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -636,8 +636,12 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
 		gpiochip->irqchip = NULL;
 		return -EINVAL;
 	}
-	irqchip->irq_request_resources = gpiochip_irq_reqres;
-	irqchip->irq_release_resources = gpiochip_irq_relres;
+
+	if (!irqchip->irq_request_resources &&
+	    !irqchip->irq_release_resources) {
+		irqchip->irq_request_resources = gpiochip_irq_reqres;
+		irqchip->irq_release_resources = gpiochip_irq_relres;
+	}
 
 	/*
 	 * Prepare the mapping since the irqchip shall be orthogonal to
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-08-17 13:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 12:48 [PATCH 1/2] gpio: don't override irq_*_resources() callbacks Rabin Vincent
2015-07-31 12:48 ` [PATCH 2/2] gpio: etraxfs: add interrupt support Rabin Vincent
2015-08-03  8:58   ` Linus Walleij
2015-08-03  9:34   ` Linus Walleij
2015-08-03 17:30     ` Rabin Vincent
2015-08-13  8:57       ` Linus Walleij
2015-07-31 14:54 ` [PATCH 1/2] gpio: don't override irq_*_resources() callbacks Grygorii Strashko
2015-08-03  8:56   ` Linus Walleij
2015-08-03  8:53 ` Linus Walleij
2015-08-17  8:40   ` Geert Uytterhoeven
2015-08-17 13:23     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).