* [PATCH v2] pwm: spear: Fix enable pwm output
@ 2013-03-30 5:37 Axel Lin
2013-03-30 9:55 ` Viresh Kumar
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2013-03-30 5:37 UTC (permalink / raw)
To: Thierry Reding; +Cc: Viresh Kumar, Shiraz Hashim, linux-kernel
The logic to check return value of clk_enable() is reversed, thus
when clk_enable() passes PWMCR_PWM_ENABLE bit is not set. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/pwm/pwm-spear.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index 69a2d9e..d836940 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);
@@ -214,7 +214,7 @@ static int spear_pwm_probe(struct platform_device *pdev)
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] 3+ messages in thread
* Re: [PATCH v2] pwm: spear: Fix enable pwm output
2013-03-30 5:37 [PATCH v2] pwm: spear: Fix enable pwm output Axel Lin
@ 2013-03-30 9:55 ` Viresh Kumar
2013-04-01 3:49 ` Shiraz Hashim
0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2013-03-30 9:55 UTC (permalink / raw)
To: Axel Lin; +Cc: Thierry Reding, Shiraz Hashim, linux-kernel
On 30 March 2013 11:07, Axel Lin <axel.lin@ingics.com> wrote:
> The logic to check return value of clk_enable() is reversed, thus
> when clk_enable() passes PWMCR_PWM_ENABLE bit is not set. Fix it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/pwm/pwm-spear.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
I am so sorry. clk_prepare also has the same issue :(
Please fix that too and i will ack it ASAP.
@Shiraz: Any idea how they went through?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pwm: spear: Fix enable pwm output
2013-03-30 9:55 ` Viresh Kumar
@ 2013-04-01 3:49 ` Shiraz Hashim
0 siblings, 0 replies; 3+ messages in thread
From: Shiraz Hashim @ 2013-04-01 3:49 UTC (permalink / raw)
To: Viresh Kumar; +Cc: Axel Lin, Thierry Reding, linux-kernel@vger.kernel.org
On Sat, Mar 30, 2013 at 05:55:41PM +0800, Viresh Kumar wrote:
> On 30 March 2013 11:07, Axel Lin <axel.lin@ingics.com> wrote:
> > The logic to check return value of clk_enable() is reversed, thus
> > when clk_enable() passes PWMCR_PWM_ENABLE bit is not set. Fix it.
> >
> > Signed-off-by: Axel Lin <axel.lin@ingics.com>
> > ---
> > drivers/pwm/pwm-spear.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> I am so sorry. clk_prepare also has the same issue :(
> Please fix that too and i will ack it ASAP.
>
> @Shiraz: Any idea how they went through?
I don't remember how :(, surely a mistake which escaped tests also.
--
regards
Shiraz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-01 3:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30 5:37 [PATCH v2] pwm: spear: Fix enable pwm output Axel Lin
2013-03-30 9:55 ` Viresh Kumar
2013-04-01 3:49 ` Shiraz Hashim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox