Thread (7 messages) flat view 7 messages, 3 authors, 2012-06-13

[PATCH 1/2] clk: cache parent clocks only for muxes

From: Russell King - ARM Linux <hidden>
Date: 2012-06-06 10:48:09
Also in: lkml

On Wed, Jun 06, 2012 at 02:41:30PM +0530, Rajendra Nayak wrote:
quoted hunk ↗ jump to hunk
caching parent clocks makes sense only when a clock has more
than one parent (mux clocks).
Avoid doing this for every other clock.

Signed-off-by: Rajendra Nayak <redacted>
---
 drivers/clk/clk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 687b00d..40568e9 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1229,7 +1229,7 @@ int __clk_init(struct device *dev, struct clk *clk)
 	 * If clk->parents is not NULL we skip this entire block.  This allows
 	 * for clock drivers to statically initialize clk->parents.
 	 */
-	if (clk->num_parents && !clk->parents) {
+	if ((clk->num_parents > 1) && !clk->parents) {
You don't need the additional parens here.  Please learn the C precedence
rules.  Additional unnecessary parens can make expressions much harder
to read.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help