From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Andrei Simion <andrei.simion@microchip.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2 1/2] ASoC: atmel-classd: Simplify probe error handling
Date: Mon, 16 Nov 2026 11:26:32 +0700 [thread overview]
Message-ID: <20261116042633.497423-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261116042633.497423-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Use dev_err_probe() for clock acquisition and regmap initialization
to suppress probe deferral logs and simplify error handling.
Also remove the unnecessary cleanup label, as all resources are
managed by devm.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Change in v2:
- Use dev_err_probe() for devm_regmap_init_mmio() error handling.
sound/soc/atmel/atmel-classd.c | 37 ++++++++++++----------------------
1 file changed, 13 insertions(+), 24 deletions(-)
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index 746e6bbbf423..59490e9effab 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -547,18 +547,14 @@ static int atmel_classd_probe(struct platform_device *pdev)
return dd->irq;
dd->pclk = devm_clk_get(dev, "pclk");
- if (IS_ERR(dd->pclk)) {
- ret = PTR_ERR(dd->pclk);
- dev_err(dev, "failed to get peripheral clock: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(dd->pclk))
+ return dev_err_probe(dev, PTR_ERR(dd->pclk),
+ "failed to get peripheral clock\n");
dd->gclk = devm_clk_get(dev, "gclk");
- if (IS_ERR(dd->gclk)) {
- ret = PTR_ERR(dd->gclk);
- dev_err(dev, "failed to get GCK clock: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(dd->gclk))
+ return dev_err_probe(dev, PTR_ERR(dd->gclk),
+ "failed to get GCK clock\n");
io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(io_base))
@@ -569,11 +565,9 @@ static int atmel_classd_probe(struct platform_device *pdev)
dd->regmap = devm_regmap_init_mmio(dev, io_base,
&atmel_classd_regmap_config);
- if (IS_ERR(dd->regmap)) {
- ret = PTR_ERR(dd->regmap);
- dev_err(dev, "failed to init register map: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(dd->regmap))
+ return dev_err_probe(dev, PTR_ERR(dd->regmap),
+ "failed to init register map\n");
ret = devm_snd_soc_register_component(dev,
&atmel_classd_cpu_dai_component,
@@ -593,29 +587,24 @@ static int atmel_classd_probe(struct platform_device *pdev)
/* register sound card */
card = devm_kzalloc_obj(dev, *card);
- if (!card) {
- ret = -ENOMEM;
- goto unregister_codec;
- }
+ if (!card)
+ return -ENOMEM;
snd_soc_card_set_drvdata(card, dd);
ret = atmel_classd_asoc_card_init(dev, card);
if (ret) {
dev_err(dev, "failed to init sound card\n");
- goto unregister_codec;
+ return ret;
}
ret = devm_snd_soc_register_card(dev, card);
if (ret) {
dev_err(dev, "failed to register sound card: %d\n", ret);
- goto unregister_codec;
+ return ret;
}
return 0;
-
-unregister_codec:
- return ret;
}
static struct platform_driver atmel_classd_driver = {
--
2.43.0
next prev parent reply other threads:[~2026-11-16 4:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 4:26 [PATCH v2 0/2] ASoC: atmel-classd: Improve clock and probe handling phucduc.bui
2026-11-16 4:26 ` phucduc.bui [this message]
2026-11-16 4:26 ` [PATCH v2 2/2] ASoC: atmel-classd: Enable pclk during probe phucduc.bui
2026-11-16 4:39 ` sashiko-bot
2026-11-16 4:54 ` Bui Duc Phuc
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=20261116042633.497423-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrei.simion@microchip.com \
--cc=broonie@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.