Skip to content

Commit 00d6070

Browse files
Sheetalbroonie
authored andcommitted
ASoC: tegra: Add error logging in tegra210_admaif driver
Log errors in the Tegra210 ADMAIF probe and runtime callback paths. Drop redundant dev_err() at tegra_isomgr_adma_register() call site since it already logs errors internally. Signed-off-by: Sheetal <sheetal@nvidia.com> Link: https://patch.msgid.link/20260401112500.4076861-2-sheetal@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7aaa804 commit 00d6070

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

sound/soc/tegra/tegra210_admaif.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ static int tegra_admaif_start(struct snd_soc_dai *dai, int direction)
408408
reg = CH_RX_REG(TEGRA_ADMAIF_RX_ENABLE, dai->id);
409409
break;
410410
default:
411+
dev_err(dai->dev, "invalid stream direction: %d\n", direction);
411412
return -EINVAL;
412413
}
413414

@@ -441,6 +442,7 @@ static int tegra_admaif_stop(struct snd_soc_dai *dai, int direction)
441442
reset_reg = CH_RX_REG(TEGRA_ADMAIF_RX_SOFT_RESET, dai->id);
442443
break;
443444
default:
445+
dev_err(dai->dev, "invalid stream direction: %d\n", direction);
444446
return -EINVAL;
445447
}
446448

@@ -489,6 +491,7 @@ static int tegra_admaif_trigger(struct snd_pcm_substream *substream, int cmd,
489491
case SNDRV_PCM_TRIGGER_SUSPEND:
490492
return tegra_admaif_stop(dai, substream->stream);
491493
default:
494+
dev_err(dai->dev, "invalid trigger command: %d\n", cmd);
492495
return -EINVAL;
493496
}
494497
}
@@ -958,18 +961,15 @@ static int tegra_admaif_probe(struct platform_device *pdev)
958961

959962
admaif->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
960963
admaif->soc_data->regmap_conf);
961-
if (IS_ERR(admaif->regmap)) {
962-
dev_err(&pdev->dev, "regmap init failed\n");
963-
return PTR_ERR(admaif->regmap);
964-
}
964+
if (IS_ERR(admaif->regmap))
965+
return dev_err_probe(&pdev->dev, PTR_ERR(admaif->regmap),
966+
"regmap init failed\n");
965967

966968
regcache_cache_only(admaif->regmap, true);
967969

968970
err = tegra_isomgr_adma_register(&pdev->dev);
969-
if (err) {
970-
dev_err(&pdev->dev, "Failed to add interconnect path\n");
971+
if (err)
971972
return err;
972-
}
973973

974974
regmap_update_bits(admaif->regmap, admaif->soc_data->global_base +
975975
TEGRA_ADMAIF_GLOBAL_ENABLE, 1, 1);
@@ -1009,11 +1009,9 @@ static int tegra_admaif_probe(struct platform_device *pdev)
10091009
admaif->soc_data->cmpnt,
10101010
admaif->soc_data->dais,
10111011
admaif->soc_data->num_ch);
1012-
if (err) {
1013-
dev_err(&pdev->dev,
1014-
"can't register ADMAIF component, err: %d\n", err);
1015-
return err;
1016-
}
1012+
if (err)
1013+
return dev_err_probe(&pdev->dev, err,
1014+
"can't register ADMAIF component\n");
10171015

10181016
pm_runtime_enable(&pdev->dev);
10191017

0 commit comments

Comments
 (0)