[PATCH] pinctrl: sirf: Remove gpiochip on failure cases

From: Pramod Gurav
Date: Sat Aug 30 2014 - 07:13:34 EST


This patch releases gpiochip related resources by calling
gpiochip_remove when gpiochip_irqchip_add fails.

CC: Linus Walleij <linus.walleij@xxxxxxxxxx>
CC: Barry Song <Baohua.Song@xxxxxxx>
CC: Rongjun Ying <rongjun.ying@xxxxxxx>
CC: Yuping Luo <yuping.luo@xxxxxxx>
Signed-off-by: Pramod Gurav <pramod.gurav@xxxxxxxxxxxxxxx>
---
drivers/pinctrl/sirf/pinctrl-sirf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 4c1d7c6..66c1837 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -839,7 +839,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
if (err) {
dev_err(&pdev->dev,
"could not connect irqchip to gpiochip\n");
- goto out;
+ goto out_banks;
}

for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/