Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 563861cd authored by Axel Lin's avatar Axel Lin Committed by Thierry Reding
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Cc: stable@vger.kernel.org
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
parent b343a188
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
		}