From: Sheetal <sheetal@nvidia.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
"Mohan Kumar" <mkumard@nvidia.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
<linux-sound@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Sheetal <sheetal@nvidia.com>
Subject: [PATCH v3 13/14] ASoC: tegra: Use dev_err_probe() in tegra_asoc_machine probe
Date: Wed, 25 Mar 2026 10:14:36 +0000 [thread overview]
Message-ID: <20260325101437.3059693-14-sheetal@nvidia.com> (raw)
In-Reply-To: <20260325101437.3059693-1-sheetal@nvidia.com>
Log errors in the Tegra ASoC machine driver probe path using
dev_err_probe().
Signed-off-by: Sheetal <sheetal@nvidia.com>
---
sound/soc/tegra/tegra_asoc_machine.c | 70 +++++++++++++++++-----------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index 10834f9c3422..d7245a10bba1 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -431,8 +431,9 @@ static int tegra_machine_register_codec(struct device *dev, const char *name)
return 0;
pdev = platform_device_register_simple(name, -1, NULL, 0);
if (IS_ERR(pdev))
- return PTR_ERR(pdev);
+ return dev_err_probe(dev, PTR_ERR(pdev),
+ "failed to register codec %s\n", name);
err = devm_add_action_or_reset(dev, tegra_machine_unregister_codec,
pdev);
@@ -468,32 +469,38 @@ int tegra_asoc_machine_probe(struct platform_device *pdev)
gpiod = devm_gpiod_get_optional(dev, "nvidia,hp-mute", GPIOD_OUT_HIGH);
machine->gpiod_hp_mute = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get hp-mute GPIO\n");
gpiod = devm_gpiod_get_optional(dev, "nvidia,hp-det", GPIOD_IN);
machine->gpiod_hp_det = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get hp-det GPIO\n");
gpiod = devm_gpiod_get_optional(dev, "nvidia,mic-det", GPIOD_IN);
machine->gpiod_mic_det = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get mic-det GPIO\n");
gpiod = devm_gpiod_get_optional(dev, "nvidia,spkr-en", GPIOD_OUT_LOW);
machine->gpiod_spkr_en = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get spkr-en GPIO\n");
gpiod = devm_gpiod_get_optional(dev, "nvidia,int-mic-en", GPIOD_OUT_LOW);
machine->gpiod_int_mic_en = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get int-mic-en GPIO\n");
gpiod = devm_gpiod_get_optional(dev, "nvidia,ext-mic-en", GPIOD_OUT_LOW);
machine->gpiod_ext_mic_en = gpiod;
if (IS_ERR(gpiod))
- return PTR_ERR(gpiod);
+ return dev_err_probe(dev, PTR_ERR(gpiod),
+ "failed to get ext-mic-en GPIO\n");
err = snd_soc_of_parse_card_name(card, "nvidia,model");
if (err)
@@ -549,22 +556,19 @@ int tegra_asoc_machine_probe(struct platform_device *pdev)
card->driver_name = "tegra";
machine->clk_pll_a = devm_clk_get(dev, "pll_a");
- if (IS_ERR(machine->clk_pll_a)) {
- dev_err(dev, "Can't retrieve clk pll_a\n");
- return PTR_ERR(machine->clk_pll_a);
- }
+ if (IS_ERR(machine->clk_pll_a))
+ return dev_err_probe(dev, PTR_ERR(machine->clk_pll_a),
+ "can't retrieve clk pll_a\n");
machine->clk_pll_a_out0 = devm_clk_get(dev, "pll_a_out0");
- if (IS_ERR(machine->clk_pll_a_out0)) {
- dev_err(dev, "Can't retrieve clk pll_a_out0\n");
- return PTR_ERR(machine->clk_pll_a_out0);
- }
+ if (IS_ERR(machine->clk_pll_a_out0))
+ return dev_err_probe(dev, PTR_ERR(machine->clk_pll_a_out0),
+ "can't retrieve clk pll_a_out0\n");
machine->clk_cdev1 = devm_clk_get(dev, "mclk");
- if (IS_ERR(machine->clk_cdev1)) {
- dev_err(dev, "Can't retrieve clk cdev1\n");
- return PTR_ERR(machine->clk_cdev1);
- }
+ if (IS_ERR(machine->clk_cdev1))
+ return dev_err_probe(dev, PTR_ERR(machine->clk_cdev1),
+ "can't retrieve clk cdev1\n");
/*
* If clock parents are not set in DT, configure here to use clk_out_1
@@ -578,26 +582,22 @@ int tegra_asoc_machine_probe(struct platform_device *pdev)
dev_warn(dev, "Please update DT to use assigned-clock-parents\n");
clk_extern1 = devm_clk_get(dev, "extern1");
- if (IS_ERR(clk_extern1)) {
- dev_err(dev, "Can't retrieve clk extern1\n");
- return PTR_ERR(clk_extern1);
- }
+ if (IS_ERR(clk_extern1))
+ return dev_err_probe(dev, PTR_ERR(clk_extern1),
+ "can't retrieve clk extern1\n");
err = clk_set_parent(clk_extern1, machine->clk_pll_a_out0);
- if (err < 0) {
- dev_err(dev, "Set parent failed for clk extern1\n");
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(dev, err,
+ "set parent failed for clk extern1\n");
clk_out_1 = devm_clk_get(dev, "pmc_clk_out_1");
- if (IS_ERR(clk_out_1)) {
- dev_err(dev, "Can't retrieve pmc_clk_out_1\n");
- return PTR_ERR(clk_out_1);
- }
+ if (IS_ERR(clk_out_1))
+ return dev_err_probe(dev, PTR_ERR(clk_out_1),
+ "can't retrieve pmc_clk_out_1\n");
err = clk_set_parent(clk_out_1, clk_extern1);
- if (err < 0) {
- dev_err(dev, "Set parent failed for pmc_clk_out_1\n");
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(dev, err,
+ "set parent failed for pmc_clk_out_1\n");
--
2.17.1
next prev parent reply other threads:[~2026-03-25 10:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 10:14 [PATCH v3 00/14] ASoC: tegra: Add error logging for probe and callback failures Sheetal
2026-03-25 10:14 ` [PATCH v3 01/14] ASoC: tegra: Use dev_err_probe() in tegra186_asrc probe Sheetal
2026-03-25 13:03 ` Mark Brown
2026-03-25 10:14 ` [PATCH v3 02/14] ASoC: tegra: Use dev_err_probe() in tegra186_dspk probe Sheetal
2026-03-25 10:14 ` [PATCH v3 03/14] ASoC: tegra: Add error logging in tegra210_admaif driver Sheetal
2026-03-25 13:05 ` Mark Brown
2026-03-25 10:14 ` [PATCH v3 04/14] ASoC: tegra: Add error logging in tegra210_adx driver Sheetal
2026-03-25 10:14 ` [PATCH v3 05/14] ASoC: tegra: Use dev_err_probe() in tegra210_ahub probe Sheetal
2026-03-25 13:07 ` Mark Brown
2026-03-25 10:14 ` [PATCH v3 06/14] ASoC: tegra: Add error logging in tegra210_amx driver Sheetal
2026-03-25 10:14 ` [PATCH v3 07/14] ASoC: tegra: Use dev_err_probe() in tegra210_dmic probe Sheetal
2026-03-25 13:08 ` Mark Brown
2026-03-25 10:14 ` [PATCH v3 08/14] ASoC: tegra: Add error logging in tegra210_i2s driver Sheetal
2026-03-25 10:14 ` [PATCH v3 09/14] ASoC: tegra: Use dev_err_probe() in OPE, PEQ and MBDRC drivers Sheetal
2026-03-25 13:10 ` Mark Brown
2026-03-25 10:14 ` [PATCH v3 10/14] ASoC: tegra: Use dev_err_probe() in tegra210_mixer probe Sheetal
2026-03-25 10:14 ` [PATCH v3 11/14] ASoC: tegra: Use dev_err_probe() in tegra210_mvc probe Sheetal
2026-03-25 10:14 ` [PATCH v3 12/14] ASoC: tegra: Use dev_err_probe() in tegra210_sfc probe Sheetal
2026-03-25 13:11 ` Mark Brown
2026-03-25 10:14 ` Sheetal [this message]
2026-03-25 10:14 ` [PATCH v3 14/14] ASoC: tegra: Use dev_err_probe() in tegra_audio_graph_card probe Sheetal
2026-03-25 13:18 ` (subset) [PATCH v3 00/14] ASoC: tegra: Add error logging for probe and callback failures Mark Brown
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=20260325101437.3059693-14-sheetal@nvidia.com \
--to=sheetal@nvidia.com \
--cc=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mkumard@nvidia.com \
--cc=perex@perex.cz \
--cc=thierry.reding@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox