mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
pwm: spear: Fix checking return value of clk_enable() and clk_prepare()
commit 563861cd63 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c0b0e8d366
commit
228c19cd8f
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user