diff options
author | Pramod Gurav <pramod.gurav@smartplayin.com> | 2014-09-09 13:35:52 +0530 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2015-02-04 10:57:47 +0000 |
commit | f2e727848d2fd8c4daf55cd658688a784505c3ca (patch) | |
tree | 4e486513f170da1471cf2bbede1e77eba81b3911 /drivers/pinctrl | |
parent | 5b4ffdb005d22d7ed5ac891cfc2c52026b7f4776 (diff) | |
download | linux-stable-f2e727848d2fd8c4daf55cd658688a784505c3ca.tar.gz linux-stable-f2e727848d2fd8c4daf55cd658688a784505c3ca.tar.bz2 linux-stable-f2e727848d2fd8c4daf55cd658688a784505c3ca.zip |
pinctrl: lantiq: Release gpiochip resources in fail case
commit 849a8c25c80a2cde824072813bf4aabbc79b8789 upstream.
This patch releases gpiochip resources with of_gpiochip_remove
and gpiochip_remove in failure cases.
CC: John Crispin <blogic@openwrt.org>
CC: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-xway.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index e66f4cae7633..37040ab42890 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c @@ -801,6 +801,7 @@ static int pinmux_xway_probe(struct platform_device *pdev) of_gpiochip_add(&xway_chip); ret = gpiochip_add(&xway_chip); if (ret) { + of_gpiochip_remove(&xway_chip); dev_err(&pdev->dev, "Failed to register gpio chip\n"); return ret; } @@ -822,6 +823,7 @@ static int pinmux_xway_probe(struct platform_device *pdev) /* register with the generic lantiq layer */ ret = ltq_pinctrl_register(pdev, &xway_info); if (ret) { + gpiochip_remove(&xway_chip); dev_err(&pdev->dev, "Failed to register pinctrl driver\n"); return ret; } |