diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2016-10-05 05:38:36 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-10-20 08:14:11 -0400 |
commit | 44df08198bc98d75085bb0ff4b54bf43e0bc40c0 (patch) | |
tree | 19b825eed4359d04fc6cec1f2b632ebeaf04618d | |
parent | 15e2a357876910623953a7c9b071096e6d976ca9 (diff) |
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>
-rw-r--r-- | drivers/gpio/gpio-mxs.c | 8 |
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) | |||
308 | writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR); | 308 | writel(~0U, port->base + PINCTRL_IRQSTAT(port) + MXS_CLR); |
309 | 309 | ||
310 | irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); | 310 | irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); |
311 | if (irq_base < 0) | 311 | if (irq_base < 0) { |
312 | return irq_base; | 312 | err = irq_base; |
313 | goto out_iounmap; | ||
314 | } | ||
313 | 315 | ||
314 | port->domain = irq_domain_add_legacy(np, 32, irq_base, 0, | 316 | port->domain = irq_domain_add_legacy(np, 32, irq_base, 0, |
315 | &irq_domain_simple_ops, NULL); | 317 | &irq_domain_simple_ops, NULL); |
@@ -349,6 +351,8 @@ out_irqdomain_remove: | |||
349 | irq_domain_remove(port->domain); | 351 | irq_domain_remove(port->domain); |
350 | out_irqdesc_free: | 352 | out_irqdesc_free: |
351 | irq_free_descs(irq_base, 32); | 353 | irq_free_descs(irq_base, 32); |
354 | out_iounmap: | ||
355 | iounmap(port->base); | ||
352 | return err; | 356 | return err; |
353 | } | 357 | } |
354 | 358 | ||