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

Commit e2b5602a authored by Johan Hovold's avatar Johan Hovold Committed by Thierry Reding
Browse files

pwm: tiehrpwm: fix clock imbalance in probe error path



Make sure to unprepare the clock before returning on late probe errors.

Fixes: b388f15f ("pwm: pwm-tiehrpwm: Use clk_enable/disable instead clk_prepare/unprepare.")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent c7fdd3f5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -489,13 +489,18 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
	ret = pwmchip_add(&pc->chip);
	if (ret < 0) {
		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
		return ret;
		goto err_clk_unprepare;
	}

	pm_runtime_enable(&pdev->dev);

	platform_set_drvdata(pdev, pc);
	return 0;

err_clk_unprepare:
	clk_unprepare(pc->tbclk);

	return ret;
}

static int ehrpwm_pwm_remove(struct platform_device *pdev)