diff options
author | Pramod Gurav <pramod.gurav@smartplayin.com> | 2014-08-31 07:21:52 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-09-05 04:34:03 -0400 |
commit | 02b837ffe033ed3b50787e0f3e4103ea5a34636b (patch) | |
tree | 51dca3e1e9b23074fb777a1f5ee8e859818c75f1 /drivers/pinctrl | |
parent | 1f81bdc7a08e7aee271a4969f451207fd7946894 (diff) |
pinctrl: at91: Switch to using managed clk_get
This patch switches to using managed version of clk_get and hence
removes clk_put from failure path.
CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 03b748ea3810..22b82ad4461c 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c | |||
@@ -1735,14 +1735,14 @@ static int at91_gpio_probe(struct platform_device *pdev) | |||
1735 | at91_chip->pioc_virq = irq; | 1735 | at91_chip->pioc_virq = irq; |
1736 | at91_chip->pioc_idx = alias_idx; | 1736 | at91_chip->pioc_idx = alias_idx; |
1737 | 1737 | ||
1738 | at91_chip->clock = clk_get(&pdev->dev, NULL); | 1738 | at91_chip->clock = devm_clk_get(&pdev->dev, NULL); |
1739 | if (IS_ERR(at91_chip->clock)) { | 1739 | if (IS_ERR(at91_chip->clock)) { |
1740 | dev_err(&pdev->dev, "failed to get clock, ignoring.\n"); | 1740 | dev_err(&pdev->dev, "failed to get clock, ignoring.\n"); |
1741 | goto err; | 1741 | goto err; |
1742 | } | 1742 | } |
1743 | 1743 | ||
1744 | if (clk_prepare(at91_chip->clock)) | 1744 | if (clk_prepare(at91_chip->clock)) |
1745 | goto clk_prep_err; | 1745 | goto err; |
1746 | 1746 | ||
1747 | /* enable PIO controller's clock */ | 1747 | /* enable PIO controller's clock */ |
1748 | if (clk_enable(at91_chip->clock)) { | 1748 | if (clk_enable(at91_chip->clock)) { |
@@ -1805,8 +1805,6 @@ static int at91_gpio_probe(struct platform_device *pdev) | |||
1805 | 1805 | ||
1806 | clk_err: | 1806 | clk_err: |
1807 | clk_unprepare(at91_chip->clock); | 1807 | clk_unprepare(at91_chip->clock); |
1808 | clk_prep_err: | ||
1809 | clk_put(at91_chip->clock); | ||
1810 | err: | 1808 | err: |
1811 | dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx); | 1809 | dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx); |
1812 | 1810 | ||