From 269effd03f6142df4c74814cfdd5f0b041b30bf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
Date: Tue, 13 Oct 2020 10:13:21 +0200
Subject: [PATCH] pwm: zx: Add missing cleanup in error path
Mime-version: 1.0
Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 8bit
Git-commit: 269effd03f6142df4c74814cfdd5f0b041b30bf9
Patch-mainline: v5.11-rc1
References: git-fixes
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 <u.kleine-koenig@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
---
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 0f5e8919b034..34e91195ce98 100644
--- a/drivers/pwm/pwm-zx.c
+++ b/drivers/pwm/pwm-zx.c
@@ -236,6 +236,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.26.2