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

Commit d73b5a99 authored by Simon South's avatar Simon South Committed by Greg Kroah-Hartman
Browse files

pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()



[ Upstream commit d5d8d675865ccddfe4da26c85f22c55cec663bf2 ]

If rockchip_pwm_probe() fails to register a PWM device it calls
clk_unprepare() for the device's PWM clock, without having first disabled
the clock and before jumping to an error handler that also unprepares
it. This is likely to produce warnings from the kernel about the clock
being unprepared when it is still enabled, and then being unprepared when
it has already been unprepared.

Prevent these warnings by removing this unnecessary call to
clk_unprepare().

Fixes: 48cf973c ("pwm: rockchip: Avoid glitches on already running PWMs")
Signed-off-by: default avatarSimon South <simon@simonsouth.net>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d786e3e7
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -370,7 +370,6 @@ static int rockchip_pwm_probe(struct platform_device *pdev)


	ret = pwmchip_add(&pc->chip);
	ret = pwmchip_add(&pc->chip);
	if (ret < 0) {
	if (ret < 0) {
		clk_unprepare(pc->clk);
		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
		goto err_pclk;
		goto err_pclk;
	}
	}