public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/7] clk: sunxi: Remove calls to clk_put
Date: Tue,  4 Mar 2014 17:17:58 +0100	[thread overview]
Message-ID: <1393949884-892-2-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1393949884-892-1-git-send-email-maxime.ripard@free-electrons.com>

Callers of clk_put must disable the clock first. This also means that as long
as the clock is enabled the driver should hold a reference to that clock.
Hence, the call to clk_put here are bogus and should be removed.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/clk/sunxi/clk-sunxi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 23baad9..7119c02 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -1290,17 +1290,13 @@ static void __init sunxi_clock_protect(void)
 
 	/* memory bus clock - sun5i+ */
 	clk = clk_get(NULL, "mbus");
-	if (!IS_ERR(clk)) {
+	if (!IS_ERR(clk))
 		clk_prepare_enable(clk);
-		clk_put(clk);
-	}
 
 	/* DDR clock - sun4i+ */
 	clk = clk_get(NULL, "pll5_ddr");
-	if (!IS_ERR(clk)) {
+	if (!IS_ERR(clk))
 		clk_prepare_enable(clk);
-		clk_put(clk);
-	}
 }
 
 static void __init sunxi_init_clocks(void)
-- 
1.9.0

  reply	other threads:[~2014-03-04 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 16:17 [PATCH v3 0/7] Add support for the Allwinner A31 DMA Controller Maxime Ripard
2014-03-04 16:17 ` Maxime Ripard [this message]
2014-03-04 16:17 ` [PATCH v3 2/7] ARM: sunxi: Split out the various machines into separate files Maxime Ripard
2014-03-04 16:18 ` [PATCH v3 3/7] ARM: sunxi: Move the clock protection to machine hooks Maxime Ripard
2014-03-04 16:18 ` [PATCH v3 4/7] ARM: sun6i: Protect CPU clock Maxime Ripard
2014-03-04 16:18 ` [PATCH v3 5/7] ARM: sun6i: Protect SDRAM gating bit Maxime Ripard
2014-03-04 16:18 ` [PATCH v3 6/7] DMA: sun6i: Add driver for the Allwinner A31 DMA controller Maxime Ripard
2014-03-05 14:07   ` Shevchenko, Andriy
2014-03-10 12:05     ` Maxime Ripard
2014-03-04 16:18 ` [PATCH v3 7/7] ARM: sun6i: dt: Add A31 DMA controller to DTSI Maxime Ripard

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=1393949884-892-2-git-send-email-maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --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