2014-10-01 18:38:13

by Pramod Gurav

[permalink] [raw]
Subject: [PATCH] gpio: grgpio: remove irq_domain resources on failure

Call irq_domain_remove when gpiochip_add fails to release irq_domain
resources.

Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
Signed-off-by: Pramod Gurav <[email protected]>
---
drivers/gpio/gpio-grgpio.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index 66ad3df..38acdce 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -441,6 +441,7 @@ static int grgpio_probe(struct platform_device *ofdev)
err = gpiochip_add(gc);
if (err) {
dev_err(&ofdev->dev, "Could not add gpiochip\n");
+ irq_domain_remove(priv->domain);
return err;
}

--
1.8.3.2


2014-10-17 09:02:35

by Alexandre Courbot

[permalink] [raw]
Subject: Re: [PATCH] gpio: grgpio: remove irq_domain resources on failure

On Thu, Oct 2, 2014 at 3:38 AM, Pramod Gurav
<[email protected]> wrote:
> Call irq_domain_remove when gpiochip_add fails to release irq_domain
> resources.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Pramod Gurav <[email protected]>
> ---
> drivers/gpio/gpio-grgpio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
> index 66ad3df..38acdce 100644
> --- a/drivers/gpio/gpio-grgpio.c
> +++ b/drivers/gpio/gpio-grgpio.c
> @@ -441,6 +441,7 @@ static int grgpio_probe(struct platform_device *ofdev)
> err = gpiochip_add(gc);
> if (err) {
> dev_err(&ofdev->dev, "Could not add gpiochip\n");
> + irq_domain_remove(priv->domain);
> return err;
> }

Acked-by: Alexandre Courbot <[email protected]>

2014-10-28 15:13:53

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpio: grgpio: remove irq_domain resources on failure

On Wed, Oct 1, 2014 at 8:38 PM, Pramod Gurav
<[email protected]> wrote:

> Call irq_domain_remove when gpiochip_add fails to release irq_domain
> resources.
>
> Cc: Linus Walleij <[email protected]>
> Cc: Alexandre Courbot <[email protected]>
> Cc: [email protected]
> Signed-off-by: Pramod Gurav <[email protected]>

Patch applied.

This driver is doing really weird stuff in it's IRQ remapping business...

Yours,
Linus Walleij