Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbbBYUmw (ORCPT ); Wed, 25 Feb 2015 15:42:52 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:61988 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbbBYUmt convert rfc822-to-8bit (ORCPT ); Wed, 25 Feb 2015 15:42:49 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Stephen Boyd , "Stephen Boyd" From: Mike Turquette In-Reply-To: <1422914983-28991-1-git-send-email-sboyd@codeaurora.org> Cc: linux-kernel@vger.kernel.org References: <1422914983-28991-1-git-send-email-sboyd@codeaurora.org> Message-ID: <20150225204233.421.61775@quantum> User-Agent: alot/0.3.5 Subject: Re: [PATCH] clk: Missing set_phase op is an error Date: Wed, 25 Feb 2015 12:42:33 -0800 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1927 Lines: 65 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 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/