[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55BB8C23.1050200@ti.com>
Date: Fri, 31 Jul 2015 17:54:27 +0300
From: Grygorii Strashko <grygorii.strashko@...com>
To: Rabin Vincent <rabin@....in>, <linus.walleij@...aro.org>,
<gnurou@...il.com>
CC: <linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] gpio: don't override irq_*_resources() callbacks
On 07/31/2015 03:48 PM, Rabin Vincent wrote:
> 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@....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;
> + }
I think, it will be better to handle req/rel cases separately.
>
> /*
> * Prepare the mapping since the irqchip shall be orthogonal to
>
Nice, thanks. I need the same actually, but I propose to make
gpiochip_irq_reqres/gpiochip_irq_relres public also, so drivers can re-use them.
--
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists