Thread (466 messages) 466 messages, 8 authors, 2020-12-30
STALE2025d REVIEWED: 1 (0M)

[PATCH 5.4 299/453] pwm: zx: Add missing cleanup in error path

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2020-12-28 13:52:32
Also in: lkml
Subsystem: pwm subsystem, the rest · Maintainers: Uwe Kleine-König, Linus Torvalds

From: Uwe Kleine-König <redacted>

[ Upstream commit 269effd03f6142df4c74814cfdd5f0b041b30bf9 ]

zx_pwm_probe() called clk_prepare_enable() before; this must be undone
in the error path.

Fixes: 4836193c435c ("pwm: Add ZTE ZX PWM device driver")
Signed-off-by: Uwe Kleine-König <redacted>
Acked-by: Shawn Guo <redacted>
Signed-off-by: Thierry Reding <redacted>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pwm/pwm-zx.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/pwm/pwm-zx.c b/drivers/pwm/pwm-zx.c
index e2c21cc34a96a..3763ce5311ac2 100644
--- a/drivers/pwm/pwm-zx.c
+++ b/drivers/pwm/pwm-zx.c
@@ -238,6 +238,7 @@ static int zx_pwm_probe(struct platform_device *pdev)
 	ret = pwmchip_add(&zpc->chip);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret);
+		clk_disable_unprepare(zpc->pclk);
 		return ret;
 	}
 
-- 
2.27.0


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help