diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-03-30 20:43:22 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-11 07:18:17 -0700 |
commit | 5412ac35167ce8bb266391f3b620ab7250ff9d3e (patch) | |
tree | 3176d9700520e800b97fc7670315b7e210e11599 | |
parent | f63a3b86960177bca59f29eb5c71e3c2fb3e91aa (diff) | |
download | lwn-5412ac35167ce8bb266391f3b620ab7250ff9d3e.tar.gz lwn-5412ac35167ce8bb266391f3b620ab7250ff9d3e.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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c index 69a2d9eb34db..3223b57e8f9c 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; } |