[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1364647402.3822.1.camel@phoenix>
Date: Sat, 30 Mar 2013 20:43:22 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Thierry Reding <thierry.reding@...onic-design.de>
Cc: Viresh Kumar <viresh.kumar@...aro.org>,
Shiraz Hashim <shiraz.hashim@...com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: [PATCH] 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@...ics.com>
Cc: <stable@...r.kernel.org>
---
This is v3 of "pwm: spear: Fix enable pwm output".
I change the subject line because it also fixes checking return value of
clk_prepare().
Also add cc stable.
Axel
drivers/pwm/pwm-spear.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
index 69a2d9e..3223b57 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;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists