Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: jason@lakedaemon.net (Jason Cooper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: mvebu: fix sscg node lookup
Date: Tue, 16 Sep 2014 11:49:31 -0400	[thread overview]
Message-ID: <20140916154931.GE29803@titan.lakedaemon.net> (raw)
In-Reply-To: <1410880503-2322-1-git-send-email-thomas.petazzoni@free-electrons.com>

On Tue, Sep 16, 2014 at 05:15:03PM +0200, Thomas Petazzoni wrote:
> Commit 15917b16022427c53755abff4dc7051f3076dd7a ("clk: mvebu: Fix clk
> frequency value if SSCG is enabled") introduced some logic in the
> common mvebu clock code to adjust the clock frequency according to the
> configuration of the SSCG.
> 
> In order to do this, it looks up for a DT node called "sscg" and maps
> it before accessing the SSCG configuration register.
> 
> However, the lookup is currently done using:
> 
> 	 sscg_np = of_find_node_by_name(np, "sscg");
> 
> where "np" is a pointer to the DT node of the clock for which we are
> calculating the adjusted frequency. This means that if the "sscg" node
> is *after* the clock node in the Device Tree, it works fine (and
> that's the case for Armada 370).
> 
> However, if it turns out that the "sscg" node is *before* the clock
> node in the Device Tree, it won't work because the sscg node will not
> be found.
> 
> What we really want here is a search of the entire Device Tree, not
> only starting from the clock node, so instead of passing "np" as first
> argument of of_find_node_by_name(), we simply need to pass
> NULL. Passing a non-NULL argument is typically used in a loop, so that
> the search for the next matching node starts right after the node that
> was matched.
> 
> This makes the "np" argument to the kirkwood_fix_sscg_deviation()
> function unnecessary, which leads to further cleanups.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Fixes: 15917b1602242 ("clk: mvebu: Fix clk frequency value if SSCG is enabled")
> ---
> Jason, this is a fix that applies on your mvebu/drivers-clk branch.
> 
>  drivers/clk/mvebu/common.c | 6 +++---
>  drivers/clk/mvebu/common.h | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied to mvebu/drivers-clk with Gregory's Ack.

thx,

Jason.

      parent reply	other threads:[~2014-09-16 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 15:15 [PATCH] clk: mvebu: fix sscg node lookup Thomas Petazzoni
2014-09-16 15:31 ` Gregory CLEMENT
2014-09-16 15:49 ` Jason Cooper [this message]

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=20140916154931.GE29803@titan.lakedaemon.net \
    --to=jason@lakedaemon.net \
    --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