summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-mxs.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2016-10-05 12:38:36 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-10-20 15:14:11 +0300
commit44df08198bc98d75085bb0ff4b54bf43e0bc40c0 (patch)
tree19b825eed4359d04fc6cec1f2b632ebeaf04618d /drivers/gpio/gpio-mxs.c
parent15e2a357876910623953a7c9b071096e6d976ca9 (diff)
downloadlinux-44df08198bc98d75085bb0ff4b54bf43e0bc40c0.tar.xz
gpio: mxs: Unmap region obtained by of_iomap
Free memory mapping, if mxs_gpio_probe is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-mxs.c')
-rw-r--r--drivers/gpio/gpio-mxs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index b9daa0bf32a4..ee1724806f46 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -308,8 +308,10 @@ static int mxs_gpio_probe(struct platform_device *pdev)
writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR);
irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
- if (irq_base < 0)
- return irq_base;
+ if (irq_base < 0) {
+ err = irq_base;
+ goto out_iounmap;
+ }
port->domain = irq_domain_add_legacy(np, 32, irq_base, 0,
&irq_domain_simple_ops, NULL);
@@ -349,6 +351,8 @@ out_irqdomain_remove:
irq_domain_remove(port->domain);
out_irqdesc_free:
irq_free_descs(irq_base, 32);
+out_iounmap:
+ iounmap(port->base);
return err;
}