Skip to contentSkip to conversation

pwm: renesas-tpu: Add missing pwmchip_remove() call in tpu_remove()

PATCH Superseded Axel Lin 3 participants 3 messages May 19, 2013 – May 20, 2013 PWM

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 pwm: renesas-tpu: Add missing pwmchip_remove() call in tpu_remove()

---
 drivers/pwm/pwm-renesas-tpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-renesas-tpu.c +1 -1
index 8e6d8d7..351addd 100644
@@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 
-	return 0;
+	return pwmchip_remove(&tpu->chip);
 }
 
 static struct platform_driver tpu_driver = {
Signature · 1 line
1.8.1.2
#1 lore raw

Hi Axel,

Thank you for the patch.

Quoted 10 lines · On Sunday 19 May 2013 13:45:31 Axel Lin wrote:
---
 drivers/pwm/pwm-renesas-tpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-renesas-tpu.c +0 -0
index 8e6d8d7..351addd 100644

drivers/pwm/pwm-renesas-tpu.c static int tpu_remove(struct platform_device *pdev) · line 447

Quoted 5 lines
drivers/pwm/pwm-renesas-tpu.c +1 -1
@@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 
-	return 0;
+	return pwmchip_remove(&tpu->chip);

Could you please move that line at the beginning of the function ? There would be a race condition otherwise, as the user could reenable PWM between the tpu_pwm_timer_stop() calls and the pwmchip_remove() call.

Apart from that, the patch looks good.

Quoted 3 lines
drivers/pwm/pwm-renesas-tpu.c +0 -0
 }
 
 static struct platform_driver tpu_driver = {
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
Quoted 18 lines · Laurent Pinchart

Hi Axel,

Thank you for the patch.

Quoted 13 lines · On Sunday 19 May 2013 13:45:31 Axel Lin wrote:
---
 drivers/pwm/pwm-renesas-tpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-renesas-tpu.c +0 -0
index 8e6d8d7..351addd 100644
@@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 
Quoted 8 lines

drivers/pwm/pwm-renesas-tpu.c static int tpu_remove(struct platform_device *pdev) · line 447

Quoted 2 lines
drivers/pwm/pwm-renesas-tpu.c +1 -1
-	return 0;
+	return pwmchip_remove(&tpu->chip);

Could you please move that line at the beginning of the function ? There would be a race condition otherwise, as the user could reenable PWM between the tpu_pwm_timer_stop() calls and the pwmchip_remove() call.

Apart from that, the patch looks good.

Also, could you please CC [email protected], that will help me track the change through patchwork.

Thanks!

Quoted 10 lines
Quoted 4 lines
drivers/pwm/pwm-renesas-tpu.c +0 -0
 }
 
 static struct platform_driver tpu_driver = {
Signature · 3 lines
Regards,

Laurent Pinchart