diff mbox

gpio: grgpio: remove irq_domain resources on failure

Message ID 1412188684-20820-1-git-send-email-pramod.gurav@smartplayin.com
State Accepted
Headers show

Commit Message

Pramod Gurav Oct. 1, 2014, 6:38 p.m. UTC
Call irq_domain_remove when gpiochip_add fails to release irq_domain
resources.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
 drivers/gpio/gpio-grgpio.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexandre Courbot Oct. 17, 2014, 9:02 a.m. UTC | #1
On Thu, Oct 2, 2014 at 3:38 AM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:
> Call irq_domain_remove when gpiochip_add fails to release irq_domain
> resources.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> ---
>  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 <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 28, 2014, 3:13 p.m. UTC | #2
On Wed, Oct 1, 2014 at 8:38 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:

> Call irq_domain_remove when gpiochip_add fails to release irq_domain
> resources.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

Patch applied.

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

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

Patch

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;
 	}