* [PATCH] pwm: spear: Fix enable pwm output
@ 2013-03-30 3:46 Axel Lin
2013-03-30 3:57 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-03-30 3:46 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 clek_enable() success PWMCR_PWM_ENABLE bit is never set. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/pwm/pwm-spear.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index 69a2d9e..cccb430 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);
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pwm: spear: Fix enable pwm output
2013-03-30 3:46 [PATCH] pwm: spear: Fix enable pwm output Axel Lin
@ 2013-03-30 3:57 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2013-03-30 3:57 UTC (permalink / raw)
To: Axel Lin; +Cc: Thierry Reding, Shiraz Hashim, linux-kernel
On 30 March 2013 09:16, Axel Lin <axel.lin@ingics.com> wrote:
> The logic to check return value of clk_enable() is reversed, thus
> when clek_enable() success PWMCR_PWM_ENABLE bit is never set. Fix it.
s/clek/clk
And write it as:
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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
> index 69a2d9e..cccb430 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;
This is okay but there is one more mistake like this in this driver.
Fix that too.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-30 3:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-30 3:46 [PATCH] pwm: spear: Fix enable pwm output Axel Lin
2013-03-30 3:57 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®