From: Alexander Stein <alexanders83@web.de>
To: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: Alexander Stein <alexanders83@web.de>,
linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org
Subject: [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable
Date: Fri, 29 Apr 2016 14:50:03 +0200 [thread overview]
Message-ID: <1461934203-3206-2-git-send-email-alexanders83@web.de> (raw)
In-Reply-To: <1461934203-3206-1-git-send-email-alexanders83@web.de>
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(-)
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);
--
2.8.1
next prev parent reply other threads:[~2016-04-29 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 12:50 [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Alexander Stein
2016-04-29 12:50 ` Alexander Stein [this message]
2016-05-02 11:53 ` [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable Linus Walleij
2016-05-02 11:52 ` [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461934203-3206-2-git-send-email-alexanders83@web.de \
--to=alexanders83@web.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).