The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Chen-Yu Tsai <wens@kernel.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Chen Ni <nichen@iscas.ac.cn>,
	Marcus Cooper <codekipper@gmail.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Danilo Krummrich <dakr@kernel.org>,
	u.kleine-koenig@baylibre.com, linux-sunxi@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sound@vger.kernel.org, bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/6] ASoC: sunxi: sun4i-i2s: Use dev_err_probe() for probe error handling
Date: Wed, 15 Jul 2026 16:55:22 +0700	[thread overview]
Message-ID: <20260715095525.40668-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260715095525.40668-1-phucduc.bui@gmail.com>

From: bui duc phuc <phucduc.bui@gmail.com>

Use dev_err_probe() for probe error handling to simplify the error paths
and handle -EPROBE_DEFER correctly.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/sunxi/sun4i-i2s.c | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 40de99a34bc3..716fa4d872ff 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1550,30 +1550,26 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
 	}
 
 	i2s->bus_clk = devm_clk_get(&pdev->dev, "apb");
-	if (IS_ERR(i2s->bus_clk)) {
-		dev_err(&pdev->dev, "Can't get our bus clock\n");
-		return PTR_ERR(i2s->bus_clk);
-	}
+	if (IS_ERR(i2s->bus_clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(i2s->bus_clk),
+				     "Can't get our bus clock\n");
 
 	i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
 					    i2s->variant->sun4i_i2s_regmap);
-	if (IS_ERR(i2s->regmap)) {
-		dev_err(&pdev->dev, "Regmap initialisation failed\n");
-		return PTR_ERR(i2s->regmap);
-	}
+	if (IS_ERR(i2s->regmap))
+		return dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap),
+				     "Regmap initialisation failed\n");
 
 	i2s->mod_clk = devm_clk_get(&pdev->dev, "mod");
-	if (IS_ERR(i2s->mod_clk)) {
-		dev_err(&pdev->dev, "Can't get our mod clock\n");
-		return PTR_ERR(i2s->mod_clk);
-	}
+	if (IS_ERR(i2s->mod_clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(i2s->mod_clk),
+				     "Can't get our mod clock\n");
 
 	if (i2s->variant->has_reset) {
 		i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-		if (IS_ERR(i2s->rst)) {
-			dev_err(&pdev->dev, "Failed to get reset control\n");
-			return PTR_ERR(i2s->rst);
-		}
+		if (IS_ERR(i2s->rst))
+			return dev_err_probe(&pdev->dev, PTR_ERR(i2s->rst),
+					     "Failed to get reset control\n");
 	}
 
 	if (!IS_ERR(i2s->rst)) {
-- 
2.43.0


  parent reply	other threads:[~2026-07-15  9:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  9:55 [PATCH 0/6] ASoC: sunxi: Simplify error handling phucduc.bui
2026-07-15  9:55 ` [PATCH 1/6] ASoC: sunxi: sun4i-codec: Use dev_err_probe() for probe " phucduc.bui
2026-07-15 14:55   ` Chen-Yu Tsai
2026-07-15  9:55 ` [PATCH 2/6] ASoC: sunxi: sun4i-codec: Drop redundant error messages phucduc.bui
2026-07-15 15:02   ` Chen-Yu Tsai
2026-07-15  9:55 ` phucduc.bui [this message]
2026-07-15 15:03   ` [PATCH 3/6] ASoC: sunxi: sun4i-i2s: Use dev_err_probe() for probe error handling Chen-Yu Tsai
2026-07-15  9:55 ` [PATCH 4/6] ASoC: sunxi: sun4i-spdif: " phucduc.bui
2026-07-15 15:03   ` Chen-Yu Tsai
2026-07-15  9:55 ` [PATCH 5/6] ASoC: sunxi: sun50i-codec-analog: Improve " phucduc.bui
2026-07-15 15:04   ` Chen-Yu Tsai
2026-07-15  9:55 ` [PATCH 6/6] ASoC: sunxi: sun8i-codec-analog: " phucduc.bui
2026-07-15 15:04   ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260715095525.40668-4-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=codekipper@gmail.com \
    --cc=dakr@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=nichen@iscas.ac.cn \
    --cc=perex@perex.cz \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox