[PATCH] pinctrl: qcom: Release pin ranges when gpiochip_irqchip_add fails

From: Pramod Gurav
Date: Wed Aug 27 2014 - 06:54:25 EST

This patches adds a call to gpiochip_remove_pin_ranges when
gpiochip_irqchip_add fails to release memory allocated for pin_ranges.

CC: Ivan T. Ivanov <iivanov@xxxxxxxxxx>
CC: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxx>
CC: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Pramod Gurav <pramod.gurav@xxxxxxxxxxxxxxx>
drivers/pinctrl/qcom/pinctrl-msm.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index f4e4f8f..aa34b5a 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -845,6 +845,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
if (ret) {
dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n");
+ gpiochip_remove_pin_ranges(chip);
return -ENOSYS;


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/