diff mbox series

pwm: stm32-lp: Remove pwm_is_enabled check before calling pwm_disable

Message ID 20171107033041.10905-1-axel.lin@ingics.com
State Accepted
Headers show
Series pwm: stm32-lp: Remove pwm_is_enabled check before calling pwm_disable | expand

Commit Message

Axel Lin Nov. 7, 2017, 3:30 a.m. UTC
The same checking is done by the implementation of pwm_disable().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pwm/pwm-stm32-lp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Fabrice Gasnier Nov. 7, 2017, 8:26 a.m. UTC | #1
On 11/07/2017 04:30 AM, Axel Lin wrote:
> The same checking is done by the implementation of pwm_disable().
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/pwm/pwm-stm32-lp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
> index 9793b296108f..1ac9e4384142 100644
> --- a/drivers/pwm/pwm-stm32-lp.c
> +++ b/drivers/pwm/pwm-stm32-lp.c
> @@ -219,8 +219,7 @@ static int stm32_pwm_lp_remove(struct platform_device *pdev)
>  	unsigned int i;
>  
>  	for (i = 0; i < priv->chip.npwm; i++)
> -		if (pwm_is_enabled(&priv->chip.pwms[i]))
> -			pwm_disable(&priv->chip.pwms[i]);
> +		pwm_disable(&priv->chip.pwms[i]);
>  
>  	return pwmchip_remove(&priv->chip);
>  }
> 

Hi Axel,

Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>

Thanks,
Fabrice
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thierry Reding Dec. 5, 2017, 8:35 a.m. UTC | #2
On Tue, Nov 07, 2017 at 11:30:41AM +0800, Axel Lin wrote:
> The same checking is done by the implementation of pwm_disable().
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/pwm/pwm-stm32-lp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

I don't think I ever mentioned that I had applied this for v4.15-rc1, so
just letting you know in case you were wondering.

Thierry
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
index 9793b296108f..1ac9e4384142 100644
--- a/drivers/pwm/pwm-stm32-lp.c
+++ b/drivers/pwm/pwm-stm32-lp.c
@@ -219,8 +219,7 @@  static int stm32_pwm_lp_remove(struct platform_device *pdev)
 	unsigned int i;
 
 	for (i = 0; i < priv->chip.npwm; i++)
-		if (pwm_is_enabled(&priv->chip.pwms[i]))
-			pwm_disable(&priv->chip.pwms[i]);
+		pwm_disable(&priv->chip.pwms[i]);
 
 	return pwmchip_remove(&priv->chip);
 }