linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] clk: Do not complain about correctly set read-only muxes when assigning clock parents from device tree
Date: Tue, 2 Dec 2014 16:20:14 +0800	[thread overview]
Message-ID: <20141202082012.GC2411@dragon> (raw)
In-Reply-To: <1417452162-20046-1-git-send-email-p.zabel@pengutronix.de>

On Mon, Dec 01, 2014 at 05:42:42PM +0100, Philipp Zabel wrote:
> Assigning a clock parent to a mux with the CLK_MUX_READ_ONLY flag causes an
> error "clk: failed to reparent read_only_mux to already_set_parent: -38"
> even if the hardware is already set to the correct parent clock.
> 
> This patch avoids the error message by checking whether the correct parent
> is already set before calling clk_set_parent. This allows to use the
> assigned-clock-parents device tree binding for clock muxes that are not
> allowed to be changed anymore at the time of_clk_set_defaults is called.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Philipp,

The patch should be sent to Mike Turquette <mturquette@linaro.org>.  The
patch itself makes sense to me, so

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Shawn

> ---
>  drivers/clk/clk-conf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
> index aad4796..ca8dc86 100644
> --- a/drivers/clk/clk-conf.c
> +++ b/drivers/clk/clk-conf.c
> @@ -62,7 +62,8 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
>  			goto err;
>  		}
>  
> -		rc = clk_set_parent(clk, pclk);
> +		if (pclk != __clk_get_parent(clk))
> +			rc = clk_set_parent(clk, pclk);
>  		if (rc < 0)
>  			pr_err("clk: failed to reparent %s to %s: %d\n",
>  			       __clk_get_name(clk), __clk_get_name(pclk), rc);
> -- 
> 2.1.3
> 

  reply	other threads:[~2014-12-02  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 16:42 [PATCH 1/2] clk: Do not complain about correctly set read-only muxes when assigning clock parents from device tree Philipp Zabel
2014-12-02  8:20 ` Shawn Guo [this message]
2014-12-02  8:48 ` Uwe Kleine-König

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=20141202082012.GC2411@dragon \
    --to=shawn.guo@linaro.org \
    --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;
as well as URLs for NNTP newsgroup(s).