mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Cc: [email protected] Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
b343a1887e
commit
563861cd63
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue