Thread (15 messages) 15 messages, 2 authors, 2021-01-13
STALE2005d

[PATCH v3 5/7] pwm: rockchip: rockchip_pwm_probe(): Remove unneeded goto target

From: Simon South <hidden>
Date: 2020-12-23 16:04:48
Also in: linux-pwm, linux-rockchip
Subsystem: arm/rockchip soc support, pwm subsystem, the rest · Maintainers: Heiko Stuebner, Uwe Kleine-König, Linus Torvalds

Eliminate the remaining goto target in rockchip_pwm_probe() by moving the
code that follows it to the point where it is invoked.

The target no longer serves any purpose as the error-handling portions of
this function no longer share any recovery steps.

Signed-off-by: Simon South <redacted>
---
 drivers/pwm/pwm-rockchip.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index d904a5d24885..80f5e69d9b8a 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -336,7 +336,8 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
 	ret = clk_prepare_enable(pc->pclk);
 	if (ret) {
 		dev_err(&pdev->dev, "Can't enable APB clk: %d\n", ret);
-		goto err_clk;
+		clk_disable_unprepare(pc->clk);
+		return ret;
 	}
 
 	platform_set_drvdata(pdev, pc);
@@ -372,11 +373,6 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
 	}
 
 	return 0;
-
-err_clk:
-	clk_disable_unprepare(pc->clk);
-
-	return ret;
 }
 
 static int rockchip_pwm_remove(struct platform_device *pdev)
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help