diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-03-30 08:43:22 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2013-04-02 05:28:36 -0400 |
commit | 563861cd633ae52932843477bb6ca3f1c9e2f78b (patch) | |
tree | e161f42351a6865ea72ca8ff9528a91b3a3990ea /drivers/pwm/pwm-spear.c | |
parent | b343a1887ea4f798758d0023838d16a428f728d5 (diff) |
pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
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>
Cc: stable@vger.kernel.org
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Diffstat (limited to 'drivers/pwm/pwm-spear.c')
-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) | |||
143 | u32 val; | 143 | u32 val; |
144 | 144 | ||
145 | rc = clk_enable(pc->clk); | 145 | rc = clk_enable(pc->clk); |
146 | if (!rc) | 146 | if (rc) |
147 | return rc; | 147 | return rc; |
148 | 148 | ||
149 | val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); | 149 | val = spear_pwm_readl(pc, pwm->hwpwm, PWMCR); |
@@ -209,12 +209,12 @@ static int spear_pwm_probe(struct platform_device *pdev) | |||
209 | pc->chip.npwm = NUM_PWM; | 209 | pc->chip.npwm = NUM_PWM; |
210 | 210 | ||
211 | ret = clk_prepare(pc->clk); | 211 | ret = clk_prepare(pc->clk); |
212 | if (!ret) | 212 | if (ret) |
213 | return ret; | 213 | return ret; |
214 | 214 | ||
215 | if (of_device_is_compatible(np, "st,spear1340-pwm")) { | 215 | if (of_device_is_compatible(np, "st,spear1340-pwm")) { |
216 | ret = clk_enable(pc->clk); | 216 | ret = clk_enable(pc->clk); |
217 | if (!ret) { | 217 | if (ret) { |
218 | clk_unprepare(pc->clk); | 218 | clk_unprepare(pc->clk); |
219 | return ret; | 219 | return ret; |
220 | } | 220 | } |