[PATCH v3 09/14] ASoC: tegra: Use dev_err_probe() in OPE, PEQ and MBDRC drivers

Sheetal
2026-03-25T10:15:42Z

Log errors in the Tegra210 OPE, PEQ and MBDRC probe paths using
dev_err_probe().

Signed-off-by: Sheetal <sheetal@nvidia.com>
---
sound/soc/tegra/tegra210_mbdrc.c | 10 +++++-----
sound/soc/tegra/tegra210_ope.c | 19 ++++++++-----------
sound/soc/tegra/tegra210_peq.c | 10 +++++-----
3 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/sound/soc/tegra/tegra210_mbdrc.c b/sound/soc/tegra/tegra210_mbdrc.c
index 6a268dbb7197..558b7a21b0be 100644
--- a/sound/soc/tegra/tegra210_mbdrc.c
+++ b/sound/soc/tegra/tegra210_mbdrc.c
@@ -987,8 +987,9 @@ int tegra210_mbdrc_regmap_init(struct platform_device *pdev)
int err;

child = of_get_child_by_name(dev->of_node, "dynamic-range-compressor");
if (!child)
- return -ENODEV;
+ return dev_err_probe(dev, -ENODEV,
+ "missing 'dynamic-range-compressor' DT child node\n");

err = of_address_to_resource(child, 0, &mem);
of_node_put(child);
@@ -1004,7 +1005,6 @@ int tegra210_mbdrc_regmap_init(struct platform_device *pdev)
ope->mbdrc_regmap = devm_regmap_init_mmio(dev, regs,
&tegra210_mbdrc_regmap_cfg);
- if (IS_ERR(ope->mbdrc_regmap)) {
- dev_err(dev, "regmap init failed\n");
- return PTR_ERR(ope->mbdrc_regmap);
- }
+ if (IS_ERR(ope->mbdrc_regmap))
+ return dev_err_probe(dev, PTR_ERR(ope->mbdrc_regmap),
+ "MBDRC regmap init failed\n");

diff --git a/sound/soc/tegra/tegra210_ope.c b/sound/soc/tegra/tegra210_ope.c
index a440888dcdbd..e311de41a078 100644
--- a/sound/soc/tegra/tegra210_ope.c
+++ b/sound/soc/tegra/tegra210_ope.c
@@ -329,23 +329,18 @@ static int tegra210_ope_probe(struct platform_device *pdev)

err = tegra210_peq_regmap_init(pdev);
- if (err < 0) {
- dev_err(dev, "PEQ init failed\n");
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(dev, err, "PEQ init failed\n");

err = tegra210_mbdrc_regmap_init(pdev);
- if (err < 0) {
- dev_err(dev, "MBDRC init failed\n");
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(dev, err, "MBDRC init failed\n");

err = devm_snd_soc_register_component(dev, &tegra210_ope_cmpnt,
tegra210_ope_dais,
ARRAY_SIZE(tegra210_ope_dais));
- if (err) {
- dev_err(dev, "can't register OPE component, err: %d\n", err);
- return err;
- }
+ if (err)
+ return dev_err_probe(dev, err,
+ "can't register OPE component\n");

pm_runtime_enable(dev);

diff --git a/sound/soc/tegra/tegra210_peq.c b/sound/soc/tegra/tegra210_peq.c
index 2f72e9d541dc..4b692c2055bc 100644
--- a/sound/soc/tegra/tegra210_peq.c
+++ b/sound/soc/tegra/tegra210_peq.c
@@ -407,8 +407,9 @@ int tegra210_peq_regmap_init(struct platform_device *pdev)
int err;

child = of_get_child_by_name(dev->of_node, "equalizer");
if (!child)
- return -ENODEV;
+ return dev_err_probe(dev, -ENODEV,
+ "missing 'equalizer' DT child node\n");

err = of_address_to_resource(child, 0, &mem);
of_node_put(child);
@@ -424,7 +425,6 @@ int tegra210_peq_regmap_init(struct platform_device *pdev)
ope->peq_regmap = devm_regmap_init_mmio(dev, regs,
&tegra210_peq_regmap_config);
- if (IS_ERR(ope->peq_regmap)) {
- dev_err(dev, "regmap init failed\n");
- return PTR_ERR(ope->peq_regmap);
- }
+ if (IS_ERR(ope->peq_regmap))
+ return dev_err_probe(dev, PTR_ERR(ope->peq_regmap),
+ "PEQ regmap init failed\n");

--
2.17.1