diff mbox

[2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable

Message ID 1461934203-3206-2-git-send-email-alexanders83@web.de
State New
Headers show

Commit Message

Alexander Stein April 29, 2016, 12:50 p.m. UTC
This simplifies the normal as well as the error path.

Signed-off-by: Alexander Stein <alexanders83@web.de>
---
 drivers/pinctrl/pinctrl-at91.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Comments

Linus Walleij May 2, 2016, 11:53 a.m. UTC | #1
On Fri, Apr 29, 2016 at 2:50 PM, Alexander Stein <alexanders83@web.de> wrote:

> This simplifies the normal as well as the error path.
>
> Signed-off-by: Alexander Stein <alexanders83@web.de>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 29d57118e35c..e380333dad46 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1730,14 +1730,9 @@  static int at91_gpio_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	ret = clk_prepare(at91_chip->clock);
-	if (ret)
-		goto clk_prepare_err;
-
-	/* enable PIO controller's clock */
-	ret = clk_enable(at91_chip->clock);
+	ret = clk_prepare_enable(at91_chip->clock);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to enable clock, ignoring.\n");
+		dev_err(&pdev->dev, "failed to prepare and enable clock, ignoring.\n");
 		goto clk_enable_err;
 	}
 
@@ -1797,10 +1792,8 @@  static int at91_gpio_probe(struct platform_device *pdev)
 irq_setup_err:
 	gpiochip_remove(chip);
 gpiochip_add_err:
-	clk_disable(at91_chip->clock);
 clk_enable_err:
-	clk_unprepare(at91_chip->clock);
-clk_prepare_err:
+	clk_disable_unprepare(at91_chip->clock);
 err:
 	dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx);