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

Simon South simon at simonsouth.net
Wed Dec 23 11:01:07 EST 2020


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 <simon at simonsouth.net>
---
 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




More information about the linux-arm-kernel mailing list