All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: atmel: Free resources only after pwmchip_remove()
@ 2021-03-24 19:56 Uwe Kleine-König
  2021-04-02 10:55 ` Claudiu.Beznea
  2021-04-09 12:28 ` Thierry Reding
  0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2021-03-24 19:56 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones
  Cc: Claudiu Beznea, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-pwm, kernel

Before pwmchip_remove() returns the PWM is expected to be functional. So
remove the pwmchip before disabling the clock.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-atmel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index a4d0be6b265b..d49da708337f 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -450,10 +450,12 @@ static int atmel_pwm_remove(struct platform_device *pdev)
 {
 	struct atmel_pwm_chip *atmel_pwm = platform_get_drvdata(pdev);
 
+	pwmchip_remove(&atmel_pwm->chip);
+
 	clk_unprepare(atmel_pwm->clk);
 	mutex_destroy(&atmel_pwm->isr_lock);
 
-	return pwmchip_remove(&atmel_pwm->chip);
+	return 0;
 }
 
 static struct platform_driver atmel_pwm_driver = {
-- 
2.30.2


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

end of thread, other threads:[~2021-04-09 12:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-24 19:56 [PATCH] pwm: atmel: Free resources only after pwmchip_remove() Uwe Kleine-König
2021-04-02 10:55 ` Claudiu.Beznea
2021-04-02 20:27   ` Uwe Kleine-König
2021-04-05  7:46     ` Claudiu.Beznea
2021-04-09 12:28 ` 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.