summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-03-30 20:43:22 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-11 13:53:50 -0700
commit228c19cd8f6d576dc6ab7d641b59aacc98952b9f (patch)
tree4ae9306851e8b1f0a174960ee3d7e4255d635258
parentc0b0e8d3666ccd7faa037a763cb6d837bf9c4f32 (diff)
downloadlinux-stable-228c19cd8f6d576dc6ab7d641b59aacc98952b9f.tar.gz
linux-stable-228c19cd8f6d576dc6ab7d641b59aacc98952b9f.tar.bz2
linux-stable-228c19cd8f6d576dc6ab7d641b59aacc98952b9f.zip
pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
commit 563861cd633ae52932843477bb6ca3f1c9e2f78b upstream. 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> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/pwm/pwm-spear.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index 83b21d9d5cf9..0c644e7d6b5a 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;
}