[PATCH 3/6] ASoC: samsung: pcm: Use dev_err_probe() for error handling

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

Replace dev_err() with dev_err_probe() to prevent log spam when probe
returns -EPROBE_DEFER.

Signed-off-by: bui duc phuc <[email protected]>
---
 sound/soc/samsung/pcm.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 309f024bf2a4..7e7284125c3e 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -499,10 +499,9 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 		return PTR_ERR(pcm->regs);
 
 	pcm->cclk = devm_clk_get(&pdev->dev, "audio-bus");
-	if (IS_ERR(pcm->cclk)) {
-		dev_err(&pdev->dev, "failed to get audio-bus clock\n");
-		return PTR_ERR(pcm->cclk);
-	}
+	if (IS_ERR(pcm->cclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(pcm->cclk),
+				     "failed to get audio-bus clock\n");
 	ret = clk_prepare_enable(pcm->cclk);
 	if (ret)
 		return ret;
@@ -512,8 +511,8 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
 
 	pcm->pclk = devm_clk_get(&pdev->dev, "pcm");
 	if (IS_ERR(pcm->pclk)) {
-		dev_err(&pdev->dev, "failed to get pcm clock\n");
-		ret = PTR_ERR(pcm->pclk);
+		ret = dev_err_probe(&pdev->dev, PTR_ERR(pcm->pclk),
+				    "failed to get pcm clock\n");
 		goto err_dis_cclk;
 	}
 	ret = clk_prepare_enable(pcm->pclk);
-- 
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.