mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak@ti.com>
To: <mturquette@ti.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH 1/2] clk: cache parent clocks only for muxes
Date: Wed, 6 Jun 2012 14:41:30 +0530	[thread overview]
Message-ID: <1338973891-28719-2-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1338973891-28719-1-git-send-email-rnayak@ti.com>

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 <rnayak@ti.com>
---
 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) {
 		clk->parents = kmalloc((sizeof(struct clk*) * clk->num_parents),
 				GFP_KERNEL);
 		/*
-- 
1.7.1


  reply	other threads:[~2012-06-06  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  9:11 [PATCH 0/2] some minor clk fixes Rajendra Nayak
2012-06-06  9:11 ` Rajendra Nayak [this message]
2012-06-06 10:47   ` [PATCH 1/2] clk: cache parent clocks only for muxes Russell King - ARM Linux
2012-06-12 19:04     ` Mike Turquette
2012-06-13  4:39       ` Rajendra Nayak
2012-06-06  9:11 ` [PATCH 2/2] clk: Allow late cache allocation for clk->parents Rajendra Nayak
2012-06-12 19:07   ` Mike Turquette

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=1338973891-28719-2-git-send-email-rnayak@ti.com \
    --to=rnayak@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@ti.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

all inboxes | Powered by JetHome®