public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Stephen Boyd <sboyd@codeaurora.org>,
	"Stephen Boyd" <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: Missing set_phase op is an error
Date: Wed, 25 Feb 2015 12:42:33 -0800	[thread overview]
Message-ID: <20150225204233.421.61775@quantum> (raw)
In-Reply-To: <1422914983-28991-1-git-send-email-sboyd@codeaurora.org>

Quoting Stephen Boyd (2015-02-02 14:09:43)
> If a clock's clk_ops doesn't have the set_phase op set we should
> return an error from clk_set_phase(). This way clock consumers
> know that when they tried to set a phase it didn't work, as
> opposed to the current behavior where the return value is 0
> meaning success.
> 
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Applied to clk-next.

Thanks,
Mike

> ---
>  drivers/clk/clk.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index a29daf9edea4..b82714a84f5e 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2069,10 +2069,10 @@ EXPORT_SYMBOL_GPL(clk_set_parent);
>   */
>  int clk_set_phase(struct clk *clk, int degrees)
>  {
> -       int ret = 0;
> +       int ret = -EINVAL;
>  
>         if (!clk)
> -               goto out;
> +               return 0;
>  
>         /* sanity check degrees */
>         degrees %= 360;
> @@ -2081,18 +2081,14 @@ int clk_set_phase(struct clk *clk, int degrees)
>  
>         clk_prepare_lock();
>  
> -       if (!clk->core->ops->set_phase)
> -               goto out_unlock;
> -
> -       ret = clk->core->ops->set_phase(clk->core->hw, degrees);
> +       if (clk->core->ops->set_phase)
> +               ret = clk->core->ops->set_phase(clk->core->hw, degrees);
>  
>         if (!ret)
>                 clk->core->phase = degrees;
>  
> -out_unlock:
>         clk_prepare_unlock();
>  
> -out:
>         return ret;
>  }
>  EXPORT_SYMBOL_GPL(clk_set_phase);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

      reply	other threads:[~2015-02-25 20:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 22:09 [PATCH] clk: Missing set_phase op is an error Stephen Boyd
2015-02-25 20:42 ` Mike Turquette [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=20150225204233.421.61775@quantum \
    --to=mturquette@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.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