Skip to contentSkip to conversation

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

PATCH In review Axel Lin 3 participants 3 messages Nov 7, 2017 – Dec 5, 2017

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 pwm: stm32-lp: Remove pwm_is_enabled check before calling pwm_disable

The same checking is done by the implementation of pwm_disable().

---
 drivers/pwm/pwm-stm32-lp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pwm/pwm-stm32-lp.c +1 -2
index 9793b296108f..1ac9e4384142 100644
@@ -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);
 }
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Axel Lin

The same checking is done by the implementation of pwm_disable().

---
 drivers/pwm/pwm-stm32-lp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pwm/pwm-stm32-lp.c +0 -0
index 9793b296108f..1ac9e4384142 100644

drivers/pwm/pwm-stm32-lp.c static int stm32_pwm_lp_remove(struct platform_device *pdev) · line 225

Quoted 9 lines
drivers/pwm/pwm-stm32-lp.c +1 -2
@@ -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,

Thanks,
Fabrice

#2 lore raw
In reply to Axel Lin
Quoted 6 lines · Axel Lin

The same checking is done by the implementation of pwm_disable().

---
 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