* [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
@ 2013-03-30 12:43 Axel Lin
2013-03-30 12:44 ` Viresh Kumar
2013-04-02 9:35 ` Thierry Reding
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2013-03-30 12:43 UTC (permalink / raw)
To: Thierry Reding; +Cc: Viresh Kumar, Shiraz Hashim, linux-kernel, stable
The logic to check return value of clk_enable() and clk_prepare() is reversed,
fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: <stable@vger.kernel.org>
---
This is v3 of "pwm: spear: Fix enable pwm output".
I change the subject line because it also fixes checking return value of
clk_prepare().
Also add cc stable.
Axel
drivers/pwm/pwm-spear.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index 69a2d9e..3223b57 100644
--- a/drivers/pwm/pwm-spear.c
+++ b/drivers/pwm/pwm-spear.c
@@ -143,7 +143,7 @@ static int spear_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
u32 val;
rc = clk_enable(pc->clk);
- if (!rc)
+ if (rc)
return rc;
val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR);
@@ -209,12 +209,12 @@ static int spear_pwm_probe(struct platform_device *pdev)
pc->chip.npwm = NUM_PWM;
ret = clk_prepare(pc->clk);
- if (!ret)
+ if (ret)
return ret;
if (of_device_is_compatible(np, "st,spear1340-pwm")) {
ret = clk_enable(pc->clk);
- if (!ret) {
+ if (ret) {
clk_unprepare(pc->clk);
return ret;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
2013-03-30 12:43 [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare() Axel Lin
@ 2013-03-30 12:44 ` Viresh Kumar
2013-03-30 12:46 ` Axel Lin
2013-04-02 9:35 ` Thierry Reding
1 sibling, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2013-03-30 12:44 UTC (permalink / raw)
To: Axel Lin; +Cc: Thierry Reding, Shiraz Hashim, linux-kernel, stable
On 30 March 2013 18:13, Axel Lin <axel.lin@ingics.com> wrote:
> The logic to check return value of clk_enable() and clk_prepare() is reversed,
> fix it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Cc: <stable@vger.kernel.org>
> ---
> This is v3 of "pwm: spear: Fix enable pwm output".
> I change the subject line because it also fixes checking return value of
> clk_prepare().
> Also add cc stable.
>
> Axel
>
> drivers/pwm/pwm-spear.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Sorry for the delays caused due to me.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
2013-03-30 12:44 ` Viresh Kumar
@ 2013-03-30 12:46 ` Axel Lin
0 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2013-03-30 12:46 UTC (permalink / raw)
To: Viresh Kumar; +Cc: Thierry Reding, Shiraz Hashim, linux-kernel, stable
>
> Sorry for the delays caused due to me.
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Actually, I'm really appreciate having your review.
Thanks,
Axel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
2013-03-30 12:43 [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare() Axel Lin
2013-03-30 12:44 ` Viresh Kumar
@ 2013-04-02 9:35 ` Thierry Reding
1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2013-04-02 9:35 UTC (permalink / raw)
To: Axel Lin; +Cc: Viresh Kumar, Shiraz Hashim, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
On Sat, Mar 30, 2013 at 08:43:22PM +0800, Axel Lin wrote:
> The logic to check return value of clk_enable() and clk_prepare() is reversed,
> fix it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Cc: <stable@vger.kernel.org>
> ---
> This is v3 of "pwm: spear: Fix enable pwm output".
> I change the subject line because it also fixes checking return value of
> clk_prepare().
> Also add cc stable.
Applied, thanks.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-02 9:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-30 12:43 [PATCH] pwm: spear: Fix checking return value of clk_enable() and clk_prepare() Axel Lin
2013-03-30 12:44 ` Viresh Kumar
2013-03-30 12:46 ` Axel Lin
2013-04-02 9:35 ` Thierry Reding
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.