All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: zx: Add missing cleanup in error path
@ 2020-10-13  8:13 Uwe Kleine-König
  2020-10-14  2:01 ` Shawn Guo
  2020-11-11 18:13 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2020-10-13  8:13 UTC (permalink / raw)
  To: Shawn Guo; +Cc: Thierry Reding, Lee Jones, linux-pwm

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>
---
 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 e2c21cc34a96..3763ce5311ac 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.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: zx: Add missing cleanup in error path
  2020-10-13  8:13 [PATCH] pwm: zx: Add missing cleanup in error path Uwe Kleine-König
@ 2020-10-14  2:01 ` Shawn Guo
  2020-11-11 18:13 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2020-10-14  2:01 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Thierry Reding, Lee Jones, linux-pwm

On Tue, Oct 13, 2020 at 4:13 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: zx: Add missing cleanup in error path
  2020-10-13  8:13 [PATCH] pwm: zx: Add missing cleanup in error path Uwe Kleine-König
  2020-10-14  2:01 ` Shawn Guo
@ 2020-11-11 18:13 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2020-11-11 18:13 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Shawn Guo, Lee Jones, linux-pwm

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Tue, Oct 13, 2020 at 10:13:21AM +0200, Uwe Kleine-König wrote:
> 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>
> ---
>  drivers/pwm/pwm-zx.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-11 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13  8:13 [PATCH] pwm: zx: Add missing cleanup in error path Uwe Kleine-König
2020-10-14  2:01 ` Shawn Guo
2020-11-11 18:13 ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.