All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Lee Jones" <lee.jones@linaro.org>
Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] pwm: lpc18xx-sct: Free resources only after pwmchip_remove()
Date: Wed, 31 Mar 2021 23:37:37 +0300	[thread overview]
Message-ID: <3797dc74-5f61-826f-307d-221a39f563af@mleia.com> (raw)
In-Reply-To: <20210327212428.136684-1-u.kleine-koenig@pengutronix.de>

Hi Uwe,

On 3/27/21 11:24 PM, Uwe Kleine-König wrote:
> 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-lpc18xx-sct.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-lpc18xx-sct.c b/drivers/pwm/pwm-lpc18xx-sct.c
> index 3f8e54ec28c6..b643ac61a2e7 100644
> --- a/drivers/pwm/pwm-lpc18xx-sct.c
> +++ b/drivers/pwm/pwm-lpc18xx-sct.c
> @@ -441,13 +441,15 @@ static int lpc18xx_pwm_remove(struct platform_device *pdev)
>   	struct lpc18xx_pwm_chip *lpc18xx_pwm = platform_get_drvdata(pdev);
>   	u32 val;
>   
> +	pwmchip_remove(&lpc18xx_pwm->chip);
> +
>   	val = lpc18xx_pwm_readl(lpc18xx_pwm, LPC18XX_PWM_CTRL);
>   	lpc18xx_pwm_writel(lpc18xx_pwm, LPC18XX_PWM_CTRL,
>   			   val | LPC18XX_PWM_CTRL_HALT);
>   
>   	clk_disable_unprepare(lpc18xx_pwm->pwm_clk);
>   
> -	return pwmchip_remove(&lpc18xx_pwm->chip);
> +	return 0;
>   }
>   
>   static struct platform_driver lpc18xx_pwm_driver = {
> 

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

A horde of PWM drivers does not satisfy the condition, please check
at least quite popular pwm-rockchip.c, pwm-sti.c, pwm-vt8500.c,
pwm-bcm2835.c etc., again, it would be preferable to see all the
drivers fixed in a single series, thank you.

--
Best wishes,
Vladimir

  reply	other threads:[~2021-03-31 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 21:24 [PATCH] pwm: lpc18xx-sct: Free resources only after pwmchip_remove() Uwe Kleine-König
2021-03-31 20:37 ` Vladimir Zapolskiy [this message]
2021-04-05 20:16   ` Uwe Kleine-König
2021-04-09 12:45 ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3797dc74-5f61-826f-307d-221a39f563af@mleia.com \
    --to=vz@mleia.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.