[PATCH 3/4] ASoC: starfive: jh7110_tdm: Remove unnecessary goto

[email protected]
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
From: bui duc phuc <[email protected]>

The error path after jh7110_tdm_runtime_resume() failure only performs a
single cleanup operation before returning. Remove the unnecessary goto
and return directly after calling pm_runtime_disable(), simplifying the
control flow without changing the behavior.

Signed-off-by: bui duc phuc <[email protected]>
---
 sound/soc/starfive/jh7110_tdm.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c
index afdcde7df91a..5365ebe44471 100644
--- a/sound/soc/starfive/jh7110_tdm.c
+++ b/sound/soc/starfive/jh7110_tdm.c
@@ -615,16 +615,13 @@ static int jh7110_tdm_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	if (!pm_runtime_enabled(&pdev->dev)) {
 		ret = jh7110_tdm_runtime_resume(&pdev->dev);
-		if (ret)
-			goto err_pm_disable;
+		if (ret) {
+			pm_runtime_disable(&pdev->dev);
+			return ret;
+		}
 	}
 
 	return 0;
-
-err_pm_disable:
-	pm_runtime_disable(&pdev->dev);
-
-	return ret;
 }
 
 static void jh7110_tdm_dev_remove(struct platform_device *pdev)
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.