gpio: amd8111: unmap ioport on failure case
diff mbox

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

Commit Message

Pramod Gurav Oct. 1, 2014, 10:03 a.m. UTC
This change unmaps ioport when gpiochip_add fails

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-amd8111.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Alexandre Courbot Oct. 9, 2014, 6:48 a.m. UTC | #1
On Wed, Oct 1, 2014 at 7:03 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:
> This change unmaps ioport when gpiochip_add fails
>
> 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>

Yep, looks like you need this indeed.

Reviewed-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. 27, 2014, 3:27 p.m. UTC | #2
On Wed, Oct 1, 2014 at 12:03 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:

> This change unmaps ioport when gpiochip_add fails
>
> 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. Sorry for disproportionate delays...

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

Patch
diff mbox

diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index 3c09f1a6..d3d2d10 100644
--- a/drivers/gpio/gpio-amd8111.c
+++ b/drivers/gpio/gpio-amd8111.c
@@ -223,6 +223,7 @@  found:
 	if (err) {
 		printk(KERN_ERR "GPIO registering failed (%d)\n",
 		       err);
+		ioport_unmap(gp.pm);
 		release_region(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
 		goto out;
 	}