Commit b547b5e5 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Bartosz Golaszewski

gpio: tb10x: Fix an error handling path in tb10x_gpio_probe()

If an error occurs after a successful irq_domain_add_linear() call, it
should be undone by a corresponding irq_domain_remove(), as already done
in the remove function.

Fixes: c6ce2b6b ("gpio: add TB10x GPIO driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 2d48c301
...@@ -195,7 +195,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev) ...@@ -195,7 +195,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE, handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE,
IRQ_GC_INIT_MASK_CACHE); IRQ_GC_INIT_MASK_CACHE);
if (ret) if (ret)
return ret; goto err_remove_domain;
gc = tb10x_gpio->domain->gc->gc[0]; gc = tb10x_gpio->domain->gc->gc[0];
gc->reg_base = tb10x_gpio->base; gc->reg_base = tb10x_gpio->base;
...@@ -209,6 +209,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev) ...@@ -209,6 +209,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
} }
return 0; return 0;
err_remove_domain:
irq_domain_remove(tb10x_gpio->domain);
return ret;
} }
static int tb10x_gpio_remove(struct platform_device *pdev) static int tb10x_gpio_remove(struct platform_device *pdev)
......
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