[PATCH v3 10/10] ASoC: ti: rx51: Use dev_err_probe() for error handling

From: phucduc . bui

Date: Thu Jul 16 2026 - 06:44:13 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Replace dev_err() with dev_err_probe() when reporting probe
failures. This preserves the original error code and suppresses
unnecessary log messages for deferred probe errors.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---

Changes in v3:
- Add the remaining missing parentheses to `snd_soc_register_card()`
(Cezary).

sound/soc/ti/rx51.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/sound/soc/ti/rx51.c b/sound/soc/ti/rx51.c
index cfc23e0838c2..b13faf162c75 100644
--- a/sound/soc/ti/rx51.c
+++ b/sound/soc/ti/rx51.c
@@ -418,31 +418,27 @@ static int rx51_soc_probe(struct platform_device *pdev)
pdata->tvout_selection_gpio = devm_gpiod_get(card->dev,
"tvout-selection",
GPIOD_OUT_LOW);
- if (IS_ERR(pdata->tvout_selection_gpio)) {
- dev_err(card->dev, "could not get tvout selection gpio\n");
- return PTR_ERR(pdata->tvout_selection_gpio);
- }
+ if (IS_ERR(pdata->tvout_selection_gpio))
+ return dev_err_probe(card->dev, PTR_ERR(pdata->tvout_selection_gpio),
+ "could not get tvout selection gpio\n");

pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch",
GPIOD_OUT_HIGH);
- if (IS_ERR(pdata->eci_sw_gpio)) {
- dev_err(card->dev, "could not get eci switch gpio\n");
- return PTR_ERR(pdata->eci_sw_gpio);
- }
+ if (IS_ERR(pdata->eci_sw_gpio))
+ return dev_err_probe(card->dev, PTR_ERR(pdata->eci_sw_gpio),
+ "could not get eci switch gpio\n");

pdata->speaker_amp_gpio = devm_gpiod_get(card->dev,
"speaker-amplifier",
GPIOD_OUT_LOW);
- if (IS_ERR(pdata->speaker_amp_gpio)) {
- dev_err(card->dev, "could not get speaker enable gpio\n");
- return PTR_ERR(pdata->speaker_amp_gpio);
- }
+ if (IS_ERR(pdata->speaker_amp_gpio))
+ return dev_err_probe(card->dev, PTR_ERR(pdata->speaker_amp_gpio),
+ "could not get speaker enable gpio\n");

err = devm_snd_soc_register_card(card->dev, card);
- if (err) {
- dev_err(card->dev, "snd_soc_register_card failed (%d)\n", err);
- return err;
- }
+ if (err)
+ return dev_err_probe(card->dev, err,
+ "snd_soc_register_card() failed\n");

return 0;
}
--
2.43.0