From: Stephen Boyd <sboyd@codeaurora.org>
To: Dong Aisheng <aisheng.dong@freescale.com>, linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mturquette@linaro.org,
shawn.guo@linaro.org, b29396@freescale.com,
linux-arm-kernel@lists.infradead.org,
Ranjani.Vaidyanathan@freescale.com, b20596@freescale.com,
r64343@freescale.com, b20788@freescale.com
Subject: Re: [PATCH RFC v1 3/5] clk: remove unneeded __clk_enable and __clk_disable
Date: Thu, 30 Apr 2015 15:05:48 -0700 [thread overview]
Message-ID: <20150430220548.GA31047@codeaurora.org> (raw)
In-Reply-To: <55427DDE.4090907@codeaurora.org>
On 04/30, Stephen Boyd wrote:
> On 04/15/15 07:26, Dong Aisheng wrote:
> > The only thing __clk_enable/__clk_disable does is NULL pointer checking
> > of clk except calling clk_core_{enable|disable} which is already handled
> > by clk_core_{enable|disable}.
> > So remove this unneeded function.
> >
> > Cc: Mike Turquette <mturquette@linaro.org>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
> > ---
>
> No. You can call clk_enable() and clk_disable() with NULL and it should
> be a no-op. With this change it would cause a NULL pointer exception.
>
Here's the proper patch. I'll leave you as author.
---8<---
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0227ac3d5b1a..e45255226ffa 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1023,14 +1023,6 @@ static void clk_core_disable(struct clk_core *core)
clk_core_disable(core->parent);
}
-static void __clk_disable(struct clk *clk)
-{
- if (!clk)
- return;
-
- clk_core_disable(clk->core);
-}
-
/**
* clk_disable - gate a clock
* @clk: the clk being gated
@@ -1051,7 +1043,7 @@ void clk_disable(struct clk *clk)
return;
flags = clk_enable_lock();
- __clk_disable(clk);
+ clk_core_disable(clk->core);
clk_enable_unlock(flags);
}
EXPORT_SYMBOL_GPL(clk_disable);
@@ -1089,14 +1081,6 @@ static int clk_core_enable(struct clk_core *core)
return 0;
}
-static int __clk_enable(struct clk *clk)
-{
- if (!clk)
- return 0;
-
- return clk_core_enable(clk->core);
-}
-
/**
* clk_enable - ungate a clock
* @clk: the clk being ungated
@@ -1115,8 +1099,11 @@ int clk_enable(struct clk *clk)
unsigned long flags;
int ret;
+ if (!clk)
+ return 0;
+
flags = clk_enable_lock();
- ret = __clk_enable(clk);
+ ret = clk_core_enable(clk->core);
clk_enable_unlock(flags);
return ret;
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC v1 3/5] clk: remove unneeded __clk_enable and __clk_disable
Date: Thu, 30 Apr 2015 15:05:48 -0700 [thread overview]
Message-ID: <20150430220548.GA31047@codeaurora.org> (raw)
In-Reply-To: <55427DDE.4090907@codeaurora.org>
On 04/30, Stephen Boyd wrote:
> On 04/15/15 07:26, Dong Aisheng wrote:
> > The only thing __clk_enable/__clk_disable does is NULL pointer checking
> > of clk except calling clk_core_{enable|disable} which is already handled
> > by clk_core_{enable|disable}.
> > So remove this unneeded function.
> >
> > Cc: Mike Turquette <mturquette@linaro.org>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
> > ---
>
> No. You can call clk_enable() and clk_disable() with NULL and it should
> be a no-op. With this change it would cause a NULL pointer exception.
>
Here's the proper patch. I'll leave you as author.
---8<---
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0227ac3d5b1a..e45255226ffa 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1023,14 +1023,6 @@ static void clk_core_disable(struct clk_core *core)
clk_core_disable(core->parent);
}
-static void __clk_disable(struct clk *clk)
-{
- if (!clk)
- return;
-
- clk_core_disable(clk->core);
-}
-
/**
* clk_disable - gate a clock
* @clk: the clk being gated
@@ -1051,7 +1043,7 @@ void clk_disable(struct clk *clk)
return;
flags = clk_enable_lock();
- __clk_disable(clk);
+ clk_core_disable(clk->core);
clk_enable_unlock(flags);
}
EXPORT_SYMBOL_GPL(clk_disable);
@@ -1089,14 +1081,6 @@ static int clk_core_enable(struct clk_core *core)
return 0;
}
-static int __clk_enable(struct clk *clk)
-{
- if (!clk)
- return 0;
-
- return clk_core_enable(clk->core);
-}
-
/**
* clk_enable - ungate a clock
* @clk: the clk being ungated
@@ -1115,8 +1099,11 @@ int clk_enable(struct clk *clk)
unsigned long flags;
int ret;
+ if (!clk)
+ return 0;
+
flags = clk_enable_lock();
- ret = __clk_enable(clk);
+ ret = clk_core_enable(clk->core);
clk_enable_unlock(flags);
return ret;
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-04-30 22:05 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 14:26 [PATCH RFC v1 0/5] clk: support clocks which requires parent clock on during operation Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-04-15 14:26 ` [PATCH RFC v1 1/5] clk: change clk_core name of __clk_set_parent_after Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-04-30 19:06 ` Stephen Boyd
2015-04-30 19:06 ` Stephen Boyd
2015-05-04 8:15 ` Dong Aisheng
2015-05-04 8:15 ` Dong Aisheng
2015-04-15 14:26 ` [PATCH RFC v1 2/5] clk: add missing lock when call clk_core_enable in clk_set_parent Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-04-30 19:07 ` Stephen Boyd
2015-04-30 19:07 ` Stephen Boyd
2015-05-04 8:35 ` Dong Aisheng
2015-05-04 8:35 ` Dong Aisheng
2015-05-07 0:01 ` Stephen Boyd
2015-05-07 0:01 ` Stephen Boyd
2015-05-13 9:21 ` Dong Aisheng
2015-05-13 9:21 ` Dong Aisheng
2015-04-15 14:26 ` [PATCH RFC v1 3/5] clk: remove unneeded __clk_enable and __clk_disable Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-04-30 19:09 ` Stephen Boyd
2015-04-30 19:09 ` Stephen Boyd
2015-04-30 22:05 ` Stephen Boyd [this message]
2015-04-30 22:05 ` Stephen Boyd
2015-05-04 8:16 ` Dong Aisheng
2015-05-04 8:16 ` Dong Aisheng
2015-04-15 14:26 ` [PATCH RFC v1 4/5] clk: core: add CLK_SET_PARENT_ON flags to support clocks require parent on Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-05-01 1:09 ` Stephen Boyd
2015-05-01 1:09 ` Stephen Boyd
2015-05-04 10:36 ` Dong Aisheng
2015-05-04 10:36 ` Dong Aisheng
2015-05-06 23:34 ` Stephen Boyd
2015-05-06 23:34 ` Stephen Boyd
2015-05-13 9:20 ` Dong Aisheng
2015-05-13 9:20 ` Dong Aisheng
2015-04-15 14:26 ` [PATCH RFC v1 5/5] clk: introduce clk_core_enable_lock and clk_core_disable_lock functions Dong Aisheng
2015-04-15 14:26 ` Dong Aisheng
2015-05-01 1:10 ` Stephen Boyd
2015-05-01 1:10 ` Stephen Boyd
2015-05-04 10:38 ` Dong Aisheng
2015-05-04 10:38 ` Dong Aisheng
2015-04-22 6:12 ` [PATCH RFC v1 0/5] clk: support clocks which requires parent clock on during operation Dong Aisheng
2015-04-22 6:12 ` Dong Aisheng
2015-04-30 2:37 ` Dong Aisheng
2015-04-30 2:37 ` Dong Aisheng
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=20150430220548.GA31047@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=Ranjani.Vaidyanathan@freescale.com \
--cc=aisheng.dong@freescale.com \
--cc=b20596@freescale.com \
--cc=b20788@freescale.com \
--cc=b29396@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=r64343@freescale.com \
--cc=shawn.guo@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.