summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-07-15 16:55:23 +0700
committerMark Brown <broonie@kernel.org>2026-07-29 15:29:32 +0100
commitac95bdb9824699fd1196d91caa691afafcc0edf4 (patch)
treecb29b26961efc323f04c550ce26e890feccc7db0
parent3e2262df8460742b8a0cb3796e3780691e37be1f (diff)
downloadlinux-next-ac95bdb9824699fd1196d91caa691afafcc0edf4.tar.gz
linux-next-ac95bdb9824699fd1196d91caa691afafcc0edf4.zip
ASoC: sunxi: sun4i-spdif: Use dev_err_probe() for probe error handling
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> Reviewed-by: Chen-Yu Tsai <wens@kernel.org> Link: https://patch.msgid.link/20260715095525.40668-5-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/sunxi/sun4i-spdif.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index c2ec19437cd7..d979bb00312f 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -684,26 +684,23 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
&sun4i_spdif_regmap_config);
- if (IS_ERR(host->regmap)) {
- dev_err(&pdev->dev, "failed to initialise regmap.\n");
- return PTR_ERR(host->regmap);
- }
+ if (IS_ERR(host->regmap))
+ return dev_err_probe(&pdev->dev, PTR_ERR(host->regmap),
+ "failed to initialise regmap.\n");
/* Clocks */
host->apb_clk = devm_clk_get(&pdev->dev, "apb");
- if (IS_ERR(host->apb_clk)) {
- dev_err(&pdev->dev, "failed to get a apb clock.\n");
- return PTR_ERR(host->apb_clk);
- }
+ if (IS_ERR(host->apb_clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(host->apb_clk),
+ "failed to get a apb clock.\n");
if (quirks->tx_clk_name)
tx_clk_name = quirks->tx_clk_name;
host->spdif_clk = devm_clk_get(&pdev->dev, tx_clk_name);
- if (IS_ERR(host->spdif_clk)) {
- dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n",
- tx_clk_name);
- return PTR_ERR(host->spdif_clk);
- }
+ if (IS_ERR(host->spdif_clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(host->spdif_clk),
+ "failed to get the \"%s\" clock.\n",
+ tx_clk_name);
host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata;
host->dma_params_tx.maxburst = 8;