Commit 44df0819 authored by Arvind Yadav's avatar Arvind Yadav Committed by Linus Walleij

gpio: mxs: Unmap region obtained by of_iomap

Free memory mapping, if mxs_gpio_probe is not successful.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 15e2a357
...@@ -308,8 +308,10 @@ static int mxs_gpio_probe(struct platform_device *pdev) ...@@ -308,8 +308,10 @@ static int mxs_gpio_probe(struct platform_device *pdev)
writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR); writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR);
irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
if (irq_base < 0) if (irq_base < 0) {
return irq_base; err = irq_base;
goto out_iounmap;
}
port->domain = irq_domain_add_legacy(np, 32, irq_base, 0, port->domain = irq_domain_add_legacy(np, 32, irq_base, 0,
&irq_domain_simple_ops, NULL); &irq_domain_simple_ops, NULL);
...@@ -349,6 +351,8 @@ static int mxs_gpio_probe(struct platform_device *pdev) ...@@ -349,6 +351,8 @@ static int mxs_gpio_probe(struct platform_device *pdev)
irq_domain_remove(port->domain); irq_domain_remove(port->domain);
out_irqdesc_free: out_irqdesc_free:
irq_free_descs(irq_base, 32); irq_free_descs(irq_base, 32);
out_iounmap:
iounmap(port->base);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment