linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
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 09:48:05 +0100	[thread overview]
Message-ID: <20141202084805.GE2129@pengutronix.de> (raw)
In-Reply-To: <1417452162-20046-1-git-send-email-p.zabel@pengutronix.de>

Hello Philipp,

On Mon, Dec 01, 2014 at 05:42:42PM +0100, Philipp Zabel wrote:
> 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);
I'd move the check for rc < 0 into the body of the if you introduced.
i.e.:

	if (pclk != __clk_get_parent(clk)) {
		rc = clk_set_parent(clk, pclk);
		if (rc < 0)
			...
	}

Semantically it doesn't make a difference because rc is zero when this
code is reached, but it makes it a bit clearer.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

      parent reply	other threads:[~2014-12-02  8:48 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
2014-12-02  8:48 ` Uwe Kleine-König [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=20141202084805.GE2129@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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).