From: Axel Lin <axel.lin@ingics.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Shiraz Hashim <shiraz.hashim@st.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] pwm: spear: Fix enable pwm output
Date: Sat, 30 Mar 2013 13:37:28 +0800 [thread overview]
Message-ID: <1364621848.3568.0.camel@phoenix> (raw)
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
next reply other threads:[~2013-03-30 5:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 5:37 Axel Lin [this message]
2013-03-30 9:55 ` [PATCH v2] pwm: spear: Fix enable pwm output Viresh Kumar
2013-04-01 3:49 ` Shiraz Hashim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364621848.3568.0.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shiraz.hashim@st.com \
--cc=thierry.reding@avionic-design.de \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox