Skip to contentSkip to conversation

pwm: bcm2835: Remove duplicate call to clk_rate_exclusive_put()

PATCH In review Sean Young 3 participants 4 messages Dec 22, 2023 – Jan 13, 2024

Subsystems (3)
lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH v2 1/1 pwm: bcm2835: Remove duplicate call to clk_rate_exclusive_put()

devm_add_action_or_reset() already calls the action in the error case.

---
 drivers/pwm/pwm-bcm2835.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pwm/pwm-bcm2835.c +1 -3
index 307c0bd5f885..283cf27f25ba 100644
@@ -160,10 +160,8 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
 
 	ret = devm_add_action_or_reset(&pdev->dev, devm_clk_rate_exclusive_put,
 				       pc->clk);
-	if (ret) {
-		clk_rate_exclusive_put(pc->clk);
+	if (ret)
 		return ret;
-	}
 
 	pc->rate = clk_get_rate(pc->clk);
 	if (!pc->rate)
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Sean Young

devm_add_action_or_reset() already calls the action in the error case.

Signature · 1 line
Florian
#2 lore raw
In reply to Sean Young

Hello Thierry,

Quoted 17 lines · Sean Young

devm_add_action_or_reset() already calls the action in the error case.

---
 drivers/pwm/pwm-bcm2835.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pwm/pwm-bcm2835.c +0 -0
index 307c0bd5f885..283cf27f25ba 100644
@@ -160,10 +160,8 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
 

drivers/pwm/pwm-bcm2835.c static int bcm2835_pwm_probe(struct platform_device *pdev) · line 167

Quoted 10 lines
drivers/pwm/pwm-bcm2835.c +1 -3
 	ret = devm_add_action_or_reset(&pdev->dev, devm_clk_rate_exclusive_put,
 				       pc->clk);
-	if (ret) {
-		clk_rate_exclusive_put(pc->clk);
+	if (ret)
 		return ret;
-	}
 
 	pc->rate = clk_get_rate(pc->clk);
 	if (!pc->rate)

this patch should be added to your for-next branch and then your PR for the next merge window.

Also "pwm: linux/pwm.h: fix Excess kernel-doc description warning" (Message-Id: [email protected]) should be added IMHO.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#3 lore raw

Hello,

Quoted 2 lines · Uwe Kleine-König

this patch should be added to your for-next branch and then your PR for the next merge window.

This was missed for the pwm/for-6.8-rc1 PR. I added it to my for-next branch at
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next now with the intention to send it for inclusion in 6.8-rc after being in next for a few days.

Quoted 3 lines

Also "pwm: linux/pwm.h: fix Excess kernel-doc description warning" (Message-Id: [email protected]) should be added IMHO.

This one was already cared for.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |