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

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

Commit Message

Axel Lin Nov. 7, 2017, 3:30 a.m.
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. | #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

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);
 }