* [PATCH] clk: tegra: Do not return 0 on failure
@ 2020-10-29 0:48 Nicolin Chen
2020-11-20 16:16 ` Thierry Reding
0 siblings, 1 reply; 4+ messages in thread
From: Nicolin Chen @ 2020-10-29 0:48 UTC (permalink / raw)
To: jonathanh, thierry.reding, sboyd, mturquette, pgaikwad, pdeschrijver
Cc: stable, linux-kernel, linux-tegra, linux-clk
Return values from read_dt_param() will be either TRUE (1) or
FALSE (0), while dfll_fetch_pwm_params() returns 0 on success
or an ERR code on failure.
So this patch fixes the bug of returning 0 on failure.
Fixes: 36541f0499fe ("clk: tegra: dfll: support PWM regulator control")
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
drivers/clk/tegra/clk-dfll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
index cfbaa90c7adb..a5f526bb0483 100644
--- a/drivers/clk/tegra/clk-dfll.c
+++ b/drivers/clk/tegra/clk-dfll.c
@@ -1856,13 +1856,13 @@ static int dfll_fetch_pwm_params(struct tegra_dfll *td)
&td->reg_init_uV);
if (!ret) {
dev_err(td->dev, "couldn't get initialized voltage\n");
- return ret;
+ return -EINVAL;
}
ret = read_dt_param(td, "nvidia,pwm-period-nanoseconds", &pwm_period);
if (!ret) {
dev_err(td->dev, "couldn't get PWM period\n");
- return ret;
+ return -EINVAL;
}
td->pwm_rate = (NSEC_PER_SEC / pwm_period) * (MAX_DFLL_VOLTAGES - 1);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: tegra: Do not return 0 on failure
2020-10-29 0:48 [PATCH] clk: tegra: Do not return 0 on failure Nicolin Chen
@ 2020-11-20 16:16 ` Thierry Reding
2020-11-20 16:18 ` Thierry Reding
0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2020-11-20 16:16 UTC (permalink / raw)
To: Nicolin Chen
Cc: jonathanh, sboyd, mturquette, pgaikwad, pdeschrijver, stable,
linux-kernel, linux-tegra, linux-clk
[-- Attachment #1: Type: text/plain, Size: 755 bytes --]
On Wed, Oct 28, 2020 at 05:48:20PM -0700, Nicolin Chen wrote:
> Return values from read_dt_param() will be either TRUE (1) or
> FALSE (0), while dfll_fetch_pwm_params() returns 0 on success
> or an ERR code on failure.
>
> So this patch fixes the bug of returning 0 on failure.
>
> Fixes: 36541f0499fe ("clk: tegra: dfll: support PWM regulator control")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> ---
> drivers/clk/tegra/clk-dfll.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Mike, Stephen,
if you don't mind, I'll pick this up in the Tegra tree since there are a
few other Tegra clock patches on the list that may require coordination
inside the Tegra tree.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: tegra: Do not return 0 on failure
2020-11-20 16:16 ` Thierry Reding
@ 2020-11-20 16:18 ` Thierry Reding
2020-11-25 2:06 ` Stephen Boyd
0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2020-11-20 16:18 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette
Cc: Nicolin Chen, jonathanh, pgaikwad, pdeschrijver, stable,
linux-kernel, linux-tegra, linux-clk
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
On Fri, Nov 20, 2020 at 05:16:56PM +0100, Thierry Reding wrote:
> On Wed, Oct 28, 2020 at 05:48:20PM -0700, Nicolin Chen wrote:
> > Return values from read_dt_param() will be either TRUE (1) or
> > FALSE (0), while dfll_fetch_pwm_params() returns 0 on success
> > or an ERR code on failure.
> >
> > So this patch fixes the bug of returning 0 on failure.
> >
> > Fixes: 36541f0499fe ("clk: tegra: dfll: support PWM regulator control")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> > ---
> > drivers/clk/tegra/clk-dfll.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Mike, Stephen,
>
> if you don't mind, I'll pick this up in the Tegra tree since there are a
> few other Tegra clock patches on the list that may require coordination
> inside the Tegra tree.
Also, I do plan on sending the collected set of patches to you for
inclusion via PR at a later date, if that's okay with you.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: tegra: Do not return 0 on failure
2020-11-20 16:18 ` Thierry Reding
@ 2020-11-25 2:06 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2020-11-25 2:06 UTC (permalink / raw)
To: Michael Turquette, Thierry Reding
Cc: Nicolin Chen, jonathanh, pgaikwad, pdeschrijver, stable,
linux-kernel, linux-tegra, linux-clk
Quoting Thierry Reding (2020-11-20 08:18:39)
> On Fri, Nov 20, 2020 at 05:16:56PM +0100, Thierry Reding wrote:
> > On Wed, Oct 28, 2020 at 05:48:20PM -0700, Nicolin Chen wrote:
> > > Return values from read_dt_param() will be either TRUE (1) or
> > > FALSE (0), while dfll_fetch_pwm_params() returns 0 on success
> > > or an ERR code on failure.
> > >
> > > So this patch fixes the bug of returning 0 on failure.
> > >
> > > Fixes: 36541f0499fe ("clk: tegra: dfll: support PWM regulator control")
> > > Cc: <stable@vger.kernel.org>
> > > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> > > ---
> > > drivers/clk/tegra/clk-dfll.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Mike, Stephen,
> >
> > if you don't mind, I'll pick this up in the Tegra tree since there are a
> > few other Tegra clock patches on the list that may require coordination
> > inside the Tegra tree.
>
> Also, I do plan on sending the collected set of patches to you for
> inclusion via PR at a later date, if that's okay with you.
>
Ok sure.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-25 2:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 0:48 [PATCH] clk: tegra: Do not return 0 on failure Nicolin Chen
2020-11-20 16:16 ` Thierry Reding
2020-11-20 16:18 ` Thierry Reding
2020-11-25 2:06 ` Stephen Boyd
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).