Commit 8b67a1f0 authored by Rabin Vincent's avatar Rabin Vincent Committed by Linus Walleij

gpio: don't override irq_*_resources() callbacks

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: default avatarRabin Vincent <rabin@rab.in>
[Added a small comment blurb]
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 50593613
...@@ -641,8 +641,16 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip, ...@@ -641,8 +641,16 @@ int gpiochip_irqchip_add(struct gpio_chip *gpiochip,
gpiochip->irqchip = NULL; gpiochip->irqchip = NULL;
return -EINVAL; return -EINVAL;
} }
/*
* It is possible for a driver to override this, but only if the
* alternative functions are both implemented.
*/
if (!irqchip->irq_request_resources &&
!irqchip->irq_release_resources) {
irqchip->irq_request_resources = gpiochip_irq_reqres; irqchip->irq_request_resources = gpiochip_irq_reqres;
irqchip->irq_release_resources = gpiochip_irq_relres; irqchip->irq_release_resources = gpiochip_irq_relres;
}
/* /*
* Prepare the mapping since the irqchip shall be orthogonal to * Prepare the mapping since the irqchip shall be orthogonal to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment