summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorPramod Gurav <pramod.gurav@smartplayin.com>2014-08-29 13:41:48 +0530
committerLinus Walleij <linus.walleij@linaro.org>2014-09-02 14:27:40 +0200
commitc6e927a27498bf9314ba8e313d15d1b3f6046d7f (patch)
tree6fe9a1315a57f773c09557d9e4562ade9234bf5a /drivers/pinctrl
parenta198420028bb6ddb1930dddc3602a3e9b4803ed5 (diff)
downloadop-kernel-dev-c6e927a27498bf9314ba8e313d15d1b3f6046d7f.zip
op-kernel-dev-c6e927a27498bf9314ba8e313d15d1b3f6046d7f.tar.gz
pinctrl: qcom: remove gpiochip in failure cases
This patch releases gpiochip related resources by calling gpiochip_remove when either of gpiochip_add_pin_range and gpiochip_irqchip_add fails. CC: Linus Walleij <linus.walleij@linaro.org> CC: "Ivan T. Ivanov" <iivanov@mm-sol.com> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 2738108..9175bbc 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -829,6 +829,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio);
if (ret) {
dev_err(pctrl->dev, "Failed to add pin range\n");
+ gpiochip_remove(&pctrl->chip);
return ret;
}
@@ -839,6 +840,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
IRQ_TYPE_NONE);
if (ret) {
dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n");
+ gpiochip_remove(&pctrl->chip);
return -ENOSYS;
}
OpenPOWER on IntegriCloud