From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] amba: Convert to clk_prepare_enable and clk_disable_unprepare
Date: Tue, 3 Dec 2013 10:09:26 +0000 [thread overview]
Message-ID: <20131203100926.GQ16735@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1386065071-9529-6-git-send-email-ulf.hansson@linaro.org>
On Tue, Dec 03, 2013 at 11:04:30AM +0100, Ulf Hansson wrote:
> To simplify code and error handling let's use clk_prepare_enable
> and clk_disable_unprepare. No functional change.
Not true.
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> drivers/amba/bus.c | 30 ++++++------------------------
> 1 file changed, 6 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index b90dc1e..0477131 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -151,36 +151,18 @@ postcore_initcall(amba_init);
>
> static int amba_get_enable_pclk(struct amba_device *pcdev)
> {
> - struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
> - int ret;
> -
> - pcdev->pclk = pclk;
> -
> - if (IS_ERR(pclk))
> - return PTR_ERR(pclk);
> + pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk");
>
> - ret = clk_prepare(pclk);
> - if (ret) {
> - clk_put(pclk);
> - return ret;
> - }
> + if (IS_ERR(pcdev->pclk))
> + return PTR_ERR(pcdev->pclk);
>
> - ret = clk_enable(pclk);
> - if (ret) {
> - clk_unprepare(pclk);
> - clk_put(pclk);
> - }
> -
> - return ret;
> + return clk_prepare_enable(pcdev->pclk);
There is clearly a change here in the error handling.
next prev parent reply other threads:[~2013-12-03 10:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 10:04 [PATCH 0/6] amba: Drop legacy PM support and some other PM improvements Ulf Hansson
2013-12-03 10:04 ` [PATCH 1/6] ALSA: AACI: Convert to modern PM ops Ulf Hansson
2013-12-03 16:45 ` Takashi Iwai
2013-12-03 10:04 ` [PATCH 2/6] serial: pl010: " Ulf Hansson
2013-12-03 10:04 ` [PATCH 3/6] serial: pl011: " Ulf Hansson
2013-12-03 10:04 ` [PATCH 4/6] amba: Drop legacy PM support and use the pm_generic functions Ulf Hansson
2013-12-03 10:04 ` [PATCH 5/6] amba: Convert to clk_prepare_enable and clk_disable_unprepare Ulf Hansson
2013-12-03 10:09 ` Russell King - ARM Linux [this message]
2013-12-03 10:35 ` Ulf Hansson
2013-12-03 10:04 ` [PATCH 6/6] amba: Add clk_prepare|unprepare in runtime PM callbacks Ulf Hansson
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=20131203100926.GQ16735@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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).