ASoC: tegra: Add error logging for probe and callback failures
Subsystems (3)
v3 cover ASoC: tegra: Add error logging for probe and callback failures
Log errors in probe and runtime error paths across Tegra audio drivers. Use dev_err_probe() in probe paths and dev_err() in runtime callbacks. Skip redundant logging where the underlying API already reports errors.
Changes in v3:
- Split single patch into per-driver patch series for easier review and incremental merging.
- Drop dev_err() from tegra_ahub_put_value_enum() since the error path is userspace-triggerable and would allow log spamming.
- Drop dev_err() from tegra210_mixer_set_audio_cif() since the driver advertises S8 format support but this function doesn't handle it, creating a userspace-triggerable log spam path.
Changes in v2:
- Use dev_err_probe() in all probe error paths as a defensive measure, instead of only where -EPROBE_DEFER is currently known to be returned.
- Drop redundant error logging for devm_platform_ioremap_resource() and devm_ioremap_resource() since these APIs already log errors internally.
Sheetal (14):
ASoC: tegra: Use dev_err_probe() in tegra186_asrc probe
ASoC: tegra: Use dev_err_probe() in tegra186_dspk probe
ASoC: tegra: Add error logging in tegra210_admaif driver
ASoC: tegra: Add error logging in tegra210_adx driver
ASoC: tegra: Use dev_err_probe() in tegra210_ahub probe
ASoC: tegra: Add error logging in tegra210_amx driver
ASoC: tegra: Use dev_err_probe() in tegra210_dmic probe
ASoC: tegra: Add error logging in tegra210_i2s driver
ASoC: tegra: Use dev_err_probe() in OPE, PEQ and MBDRC drivers
ASoC: tegra: Use dev_err_probe() in tegra210_mixer probe
ASoC: tegra: Use dev_err_probe() in tegra210_mvc probe
ASoC: tegra: Use dev_err_probe() in tegra210_sfc probe
ASoC: tegra: Use dev_err_probe() in tegra_asoc_machine probe
ASoC: tegra: Use dev_err_probe() in tegra_audio_graph_card probe
sound/soc/tegra/tegra186_asrc.c | 7 ++-- sound/soc/tegra/tegra186_dspk.c | 15 +++---- sound/soc/tegra/tegra210_admaif.c | 18 ++++---- sound/soc/tegra/tegra210_adx.c | 13 +++--- sound/soc/tegra/tegra210_ahub.c | 18 ++++---- sound/soc/tegra/tegra210_amx.c | 9 ++-- sound/soc/tegra/tegra210_dmic.c | 14 +++---- sound/soc/tegra/tegra210_i2s.c | 18 ++++---- sound/soc/tegra/tegra210_mbdrc.c | 10 ++--- sound/soc/tegra/tegra210_mixer.c | 7 ++-- sound/soc/tegra/tegra210_mvc.c | 7 ++-- sound/soc/tegra/tegra210_ope.c | 19 ++++----- sound/soc/tegra/tegra210_peq.c | 10 ++--- sound/soc/tegra/tegra210_sfc.c | 7 ++-- sound/soc/tegra/tegra_asoc_machine.c | 70 ++++++++++++++++---------------- sound/soc/tegra/tegra_audio_graph_card.c | 21 ++++++---- 16 files changed, 128 insertions(+), 135 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/14 ASoC: tegra: Use dev_err_probe() in tegra186_asrc probe
Log errors in the Tegra186 ASRC probe path using dev_err_probe().
--- sound/soc/tegra/tegra186_asrc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
sound/soc/tegra/tegra186_asrc.c +3 -4
@@ -1016,10 +1016,9 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra186_asrc_cmpnt, tegra186_asrc_dais,ARRAY_SIZE (tegra186_asrc_dais)); -if (err) { -dev_err (dev,"can't register ASRC component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register ASRC component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 01/14] ASoC: tegra: Use dev_err_probe() in tegra186_asrc probe
Quoted 2 lines · Sheetal
Log errors in the Tegra186 ASRC probe path using
dev_err_probe().
There's still dev_err() logging on regmap init failures here (I'll take this patch, please send a separate patch).
PATCH v3 2/14 ASoC: tegra: Use dev_err_probe() in tegra186_dspk probe
In reply to SheetalLog errors in the Tegra186 DSPK probe path using dev_err_probe().
--- sound/soc/tegra/tegra186_dspk.c | 15 ++++++-------- 1 file changed, 6 insertions(+), 9 deletions(-)
sound/soc/tegra/tegra186_dspk.c +6 -9
@@ -496,10 +496,9 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev)dev_set_drvdata (dev, dspk); dspk->clk_dspk =devm_clk_get (dev,"dspk" ); -if (IS_ERR (dspk->clk_dspk)) { -dev_err (dev,"can't retrieve DSPK clock\n" ); -return PTR_ERR (dspk->clk_dspk); - } +if (IS_ERR (dspk->clk_dspk)) +return dev_err_probe (dev,PTR_ERR (dspk->clk_dspk), +"can't retrieve DSPK clock\n" ); regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs))
@@ -516,11 +515,9 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra186_dspk_cmpnt, tegra186_dspk_dais,ARRAY_SIZE (tegra186_dspk_dais)); -if (err) { -dev_err (dev,"can't register DSPK component, err: %d\n" , - err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register DSPK component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 3/14 ASoC: tegra: Add error logging in tegra210_admaif driver
In reply to SheetalLog errors in the Tegra210 ADMAIF probe and runtime callback paths.
--- sound/soc/tegra/tegra210_admaif.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
sound/soc/tegra/tegra210_admaif.c +9 -9
@@ -408,6 +408,7 @@ static int tegra_admaif_start(struct snd_soc_dai *dai, int direction) reg =CH_RX_REG (TEGRA_ADMAIF_RX_ENABLE , dai->id);break ;default : +dev_err (dai->dev,"invalid stream direction: %d\n" , direction);return -EINVAL ; }
@@ -441,6 +442,7 @@ static int tegra_admaif_stop(struct snd_soc_dai *dai, int direction) reset_reg =CH_RX_REG (TEGRA_ADMAIF_RX_SOFT_RESET , dai->id);break ;default : +dev_err (dai->dev,"invalid stream direction: %d\n" , direction);return -EINVAL ; }
@@ -489,6 +491,7 @@ static int tegra_admaif_trigger(struct snd_pcm_substream *substream, int cmd,case SNDRV_PCM_TRIGGER_SUSPEND :return tegra_admaif_stop (dai, substream->stream);default : +dev_err (dai->dev,"invalid trigger command: %d\n" , cmd);return -EINVAL ; } }
@@ -966,10 +969,9 @@ static int tegra_admaif_probe(struct platform_device *pdev)regcache_cache_only (admaif->regmap, true); err =tegra_isomgr_adma_register (&pdev->dev); -if (err) { -dev_err (&pdev->dev,"Failed to add interconnect path\n" ); -return err; - } +if (err) +return dev_err_probe (&pdev->dev, err, +"failed to add interconnect path\n" );regmap_update_bits (admaif->regmap, admaif->soc_data->global_base +TEGRA_ADMAIF_GLOBAL_ENABLE ,1 ,1 );
@@ -1009,11 +1011,9 @@ static int tegra_admaif_probe(struct platform_device *pdev) admaif->soc_data->cmpnt, admaif->soc_data->dais, admaif->soc_data->num_ch); -if (err) { -dev_err (&pdev->dev, -"can't register ADMAIF component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (&pdev->dev, err, +"can't register ADMAIF component\n" );pm_runtime_enable (&pdev->dev);
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 03/14] ASoC: tegra: Add error logging in tegra210_admaif driver
sound/soc/tegra/tegra210_admaif.c static int tegra_admaif_probe(struct platform_device *pdev) · line 974
Quoted 13 lines · Sheetal
Log errors in the Tegra210 ADMAIF probe and runtime callback paths.
sound/soc/tegra/tegra210_admaif.c +3
-4@@ -966,10 +969,9 @@ static int tegra_admaif_probe(struct platform_device *pdev)regcache_cache_only (admaif->regmap, true); err =tegra_isomgr_adma_register (&pdev->dev); -if (err) { -dev_err (&pdev->dev,"Failed to add interconnect path\n" ); -return err; - } +if (err) +return dev_err_probe (&pdev->dev, err, +"failed to add interconnect path\n" );
tegra_isomgr_adma_register() already logs failures.
PATCH v3 4/14 ASoC: tegra: Add error logging in tegra210_adx driver
In reply to SheetalLog errors in the Tegra210 ADX probe and set_audio_cif paths.
--- sound/soc/tegra/tegra210_adx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
sound/soc/tegra/tegra210_adx.c +8 -5
@@ -134,8 +134,11 @@ static int tegra210_adx_set_audio_cif(struct snd_soc_dai *dai,memset (&cif_conf,0 ,sizeof (struct tegra_cif_conf )); -if (channels <1 || channels > adx->soc_data->max_ch) +if (channels <1 || channels > adx->soc_data->max_ch) { +dev_err (dai->dev,"invalid channels: %u (max %u)\n" , + channels, adx->soc_data->max_ch);return -EINVAL ; + }switch (format) {case SNDRV_PCM_FORMAT_S8 :
@@ -149,6 +152,7 @@ static int tegra210_adx_set_audio_cif(struct snd_soc_dai *dai, audio_bits =TEGRA_ACIF_BITS_32 ;break ;default : +dev_err (dai->dev,"unsupported format: %d\n" , format);return -EINVAL ; }
@@ -717,10 +721,9 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_adx_cmpnt, tegra210_adx_dais,ARRAY_SIZE (tegra210_adx_dais)); -if (err) { -dev_err (dev,"can't register ADX component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register ADX component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 5/14 ASoC: tegra: Use dev_err_probe() in tegra210_ahub probe
In reply to SheetalLog errors in the Tegra210 AHUB probe path using dev_err_probe().
--- sound/soc/tegra/tegra210_ahub.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
sound/soc/tegra/tegra210_ahub.c +8 -10
@@ -2265,10 +2265,9 @@ static int tegra_ahub_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ahub); ahub->clk =devm_clk_get (&pdev->dev,"ahub" ); -if (IS_ERR (ahub->clk)) { -dev_err (&pdev->dev,"can't retrieve AHUB clock\n" ); -return PTR_ERR (ahub->clk); - } +if (IS_ERR (ahub->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (ahub->clk), +"can't retrieve AHUB clock\n" ); regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs))
@@ -2287,16 +2286,15 @@ static int tegra_ahub_probe(struct platform_device *pdev) ahub->soc_data->cmpnt_drv, ahub->soc_data->dai_drv, ahub->soc_data->num_dais); -if (err) { -dev_err (&pdev->dev,"can't register AHUB component, err: %d\n" , - err); -return err; - } +if (err) +return dev_err_probe (&pdev->dev, err, +"can't register AHUB component\n" );pm_runtime_enable (&pdev->dev); err =of_platform_populate (pdev->dev.of_node,NULL ,NULL , &pdev->dev);if (err) {pm_runtime_disable (&pdev->dev); -return err; +return dev_err_probe (&pdev->dev, err, +"failed to populate child nodes\n" ); }
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 05/14] ASoC: tegra: Use dev_err_probe() in tegra210_ahub probe
Quoted 1 line · Sheetal
Log errors in the Tegra210 AHUB probe path using
dev_err_probe().
We also have some regmap logging in this file (again, can be done incrementally).
PATCH v3 6/14 ASoC: tegra: Add error logging in tegra210_amx driver
In reply to SheetalLog errors in the Tegra210 AMX probe and set_audio_cif paths.
--- sound/soc/tegra/tegra210_amx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
sound/soc/tegra/tegra210_amx.c +5 -4
@@ -163,6 +163,8 @@ static int tegra210_amx_set_audio_cif(struct snd_soc_dai *dai, audio_bits =TEGRA_ACIF_BITS_32 ;break ;default : +dev_err (dai->dev,"unsupported format: %d\n" , +params_format (params));return -EINVAL ; }
@@ -767,10 +769,9 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_amx_cmpnt, tegra210_amx_dais,ARRAY_SIZE (tegra210_amx_dais)); -if (err) { -dev_err (dev,"can't register AMX component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register AMX component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 7/14 ASoC: tegra: Use dev_err_probe() in tegra210_dmic probe
In reply to SheetalLog errors in the Tegra210 DMIC probe path using dev_err_probe().
--- sound/soc/tegra/tegra210_dmic.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
sound/soc/tegra/tegra210_dmic.c +6 -8
@@ -507,10 +507,9 @@ static int tegra210_dmic_probe(struct platform_device *pdev)dev_set_drvdata (dev, dmic); dmic->clk_dmic =devm_clk_get (dev,"dmic" ); -if (IS_ERR (dmic->clk_dmic)) { -dev_err (dev,"can't retrieve DMIC clock\n" ); -return PTR_ERR (dmic->clk_dmic); - } +if (IS_ERR (dmic->clk_dmic)) +return dev_err_probe (dev,PTR_ERR (dmic->clk_dmic), +"can't retrieve DMIC clock\n" ); regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (regs))
@@ -528,10 +527,9 @@ static int tegra210_dmic_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_dmic_compnt, tegra210_dmic_dais,ARRAY_SIZE (tegra210_dmic_dais)); -if (err) { -dev_err (dev,"can't register DMIC component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register DMIC component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 07/14] ASoC: tegra: Use dev_err_probe() in tegra210_dmic probe
Quoted 1 line · Sheetal
Log errors in the Tegra210 DMIC probe path using
dev_err_probe().
Another one with a regmap log.
PATCH v3 8/14 ASoC: tegra: Add error logging in tegra210_i2s driver
In reply to SheetalLog errors in the Tegra210 I2S probe and runtime callback paths.
--- sound/soc/tegra/tegra210_i2s.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
sound/soc/tegra/tegra210_i2s.c +10 -8
@@ -161,6 +161,7 @@ static int tegra210_i2s_init(struct snd_soc_dapm_widget *w, stream =SNDRV_PCM_STREAM_CAPTURE ; status_reg =TEGRA210_I2S_TX_STATUS + i2s->soc_data->tx_offset; }else { +dev_err (dev,"invalid I2S direction register 0x%x\n" , w->reg);return -EINVAL ; }
@@ -235,6 +236,7 @@ static int tegra210_i2s_set_fmt(struct snd_soc_dai *dai, val =I2S_CTRL_MASTER_EN ;break ;default : +dev_err (dai->dev,"invalid clock provider format 0x%x\n" , fmt);return -EINVAL ; }
@@ -270,6 +272,7 @@ static int tegra210_i2s_set_fmt(struct snd_soc_dai *dai,tegra210_i2s_set_data_offset (i2s,0 );break ;default : +dev_err (dai->dev,"invalid I2S frame format 0x%x\n" , fmt);return -EINVAL ; }
@@ -290,6 +293,7 @@ static int tegra210_i2s_set_fmt(struct snd_soc_dai *dai, val ^=I2S_CTRL_LRCK_POL_MASK ;break ;default : +dev_err (dai->dev,"invalid I2S clock inversion 0x%x\n" , fmt);return -EINVAL ; }
@@ -1070,10 +1074,9 @@ static int tegra210_i2s_probe(struct platform_device *pdev)dev_set_drvdata (dev, i2s); i2s->clk_i2s =devm_clk_get (dev,"i2s" ); -if (IS_ERR (i2s->clk_i2s)) { -dev_err (dev,"can't retrieve I2S bit clock\n" ); -return PTR_ERR (i2s->clk_i2s); - } +if (IS_ERR (i2s->clk_i2s)) +return dev_err_probe (dev,PTR_ERR (i2s->clk_i2s), +"can't retrieve I2S bit clock\n" );/* * Not an error, as this clock is needed only when some other I/O
@@ -1108,10 +1111,9 @@ static int tegra210_i2s_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, i2s->soc_data->i2s_cmpnt, tegra210_i2s_dais,ARRAY_SIZE (tegra210_i2s_dais)); -if (err) { -dev_err (dev,"can't register I2S component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register I2S component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 9/14 ASoC: tegra: Use dev_err_probe() in OPE, PEQ and MBDRC drivers
In reply to SheetalLog errors in the Tegra210 OPE, PEQ and MBDRC probe paths using dev_err_probe().
--- 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(-)
sound/soc/tegra/tegra210_mbdrc.c +5 -5
@@ -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" );
sound/soc/tegra/tegra210_ope.c +7 -12
@@ -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);
sound/soc/tegra/tegra210_peq.c +5 -5
@@ -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" );
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 09/14] ASoC: tegra: Use dev_err_probe() in OPE, PEQ and MBDRC drivers
sound/soc/tegra/tegra210_ope.c static int tegra210_ope_probe(struct platform_device *pdev) · line 332
Quoted 10 lines · Sheetal
Log errors in the Tegra210 OPE, PEQ and MBDRC probe paths using
dev_err_probe().sound/soc/tegra/tegra210_ope.c +2
-4err =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" );
There's dev_err_probe() logging in the called function, the dev_err_probe() here is redundant and overwrites the failure reason.
PATCH v3 10/14 ASoC: tegra: Use dev_err_probe() in tegra210_mixer probe
In reply to SheetalLog errors in the Tegra210 Mixer probe path using dev_err_probe().
--- sound/soc/tegra/tegra210_mixer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
sound/soc/tegra/tegra210_mixer.c +3 -4
@@ -651,10 +651,9 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_mixer_cmpnt, tegra210_mixer_dais,ARRAY_SIZE (tegra210_mixer_dais)); -if (err) { -dev_err (dev,"can't register MIXER component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register MIXER component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 11/14 ASoC: tegra: Use dev_err_probe() in tegra210_mvc probe
In reply to SheetalLog errors in the Tegra210 MVC probe path using dev_err_probe().
--- sound/soc/tegra/tegra210_mvc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
sound/soc/tegra/tegra210_mvc.c +3 -4
@@ -741,10 +741,9 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_mvc_cmpnt, tegra210_mvc_dais,ARRAY_SIZE (tegra210_mvc_dais)); -if (err) { -dev_err (dev,"can't register MVC component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register MVC component\n" );pm_runtime_enable (dev);
Signature · 1 line
2.17.1
PATCH v3 12/14 ASoC: tegra: Use dev_err_probe() in tegra210_sfc probe
In reply to SheetalLog errors in the Tegra210 SFC probe path using dev_err_probe().
--- sound/soc/tegra/tegra210_sfc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
sound/soc/tegra/tegra210_sfc.c +3 -4
@@ -3608,10 +3608,9 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev) err =devm_snd_soc_register_component (dev, &tegra210_sfc_cmpnt, tegra210_sfc_dais,ARRAY_SIZE (tegra210_sfc_dais)); -if (err) { -dev_err (dev,"can't register SFC component, err: %d\n" , err); -return err; - } +if (err) +return dev_err_probe (dev, err, +"can't register SFC component\n" );pm_runtime_enable (&pdev->dev);
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [PATCH v3 12/14] ASoC: tegra: Use dev_err_probe() in tegra210_sfc probe
Quoted 1 line · Sheetal
Log errors in the Tegra210 SFC probe path using
dev_err_probe().
Another one with a regmap error log not converted.
PATCH v3 13/14 ASoC: tegra: Use dev_err_probe() in tegra_asoc_machine probe
In reply to SheetalLog errors in the Tegra ASoC machine driver probe path using dev_err_probe().
--- sound/soc/tegra/tegra_asoc_machine.c | 70 +++++++++++++++++----------------- 1 file changed, 35 insertions(+), 35 deletions(-)
sound/soc/tegra/tegra_asoc_machine.c +35 -35
@@ -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" );
Signature · 1 line
2.17.1
PATCH v3 14/14 ASoC: tegra: Use dev_err_probe() in tegra_audio_graph_card probe
In reply to SheetalLog errors in the Tegra audio graph card probe path using dev_err_probe().
--- sound/soc/tegra/tegra_audio_graph_card.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
sound/soc/tegra/tegra_audio_graph_card.c +12 -9
@@ -174,20 +174,23 @@ static int tegra_audio_graph_card_probe(struct snd_soc_card *card) {struct simple_util_priv *simple =snd_soc_card_get_drvdata (card);struct tegra_audio_priv *priv =simple_to_tegra_priv (simple); +int ret; priv->clk_plla =devm_clk_get (card->dev,"pll_a" ); -if (IS_ERR (priv->clk_plla)) { -dev_err (card->dev,"Can't retrieve clk pll_a\n" ); -return PTR_ERR (priv->clk_plla); - } +if (IS_ERR (priv->clk_plla)) +return dev_err_probe (card->dev,PTR_ERR (priv->clk_plla), +"can't retrieve clk pll_a\n" ); priv->clk_plla_out0 =devm_clk_get (card->dev,"plla_out0" ); -if (IS_ERR (priv->clk_plla_out0)) { -dev_err (card->dev,"Can't retrieve clk plla_out0\n" ); -return PTR_ERR (priv->clk_plla_out0); - } +if (IS_ERR (priv->clk_plla_out0)) +return dev_err_probe (card->dev,PTR_ERR (priv->clk_plla_out0), +"can't retrieve clk plla_out0\n" ); + + ret =graph_util_card_probe (card); +if (ret <0 ) +return dev_err_probe (card->dev, ret,"graph_util_card_probe failed\n" ); -return graph_util_card_probe (card); +return ret; }static int tegra_audio_graph_probe (struct platform_device *pdev)
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: (subset) [PATCH v3 00/14] ASoC: tegra: Add error logging for probe and callback failures
In reply to SheetalQuoted 15 lines · Sheetal
ASoC: tegra: Add error logging for probe and callback failures
Log errors in probe and runtime error paths across Tegra audio drivers. Use
dev_err_probe()in probe paths anddev_err()in runtime callbacks. Skip redundant logging where the underlying API already reports errors.Changes in v3:
- Split single patch into per-driver patch series for easier review and incremental merging.
- Dropdev_err()fromtegra_ahub_put_value_enum()since the error path is userspace-triggerable and would allow log spamming.
- Dropdev_err()fromtegra210_mixer_set_audio_cif()since the driver advertises S8 format support but this function doesn't handle it, creating a userspace-triggerable log spam path.
Quoted 1 line
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
Thanks!
[01/14] ASoC: tegra: Use dev_err_probe() in tegra186_asrc probe
https://git.kernel.org/broonie/sound/c/884f3101d1ed [02/14] ASoC: tegra: Use dev_err_probe() in tegra186_dspk probe https://git.kernel.org/broonie/sound/c/6205ca05227f [04/14] ASoC: tegra: Add error logging in tegra210_adx driver https://git.kernel.org/broonie/sound/c/50e51b84a4b3 [05/14] ASoC: tegra: Use dev_err_probe() in tegra210_ahub probe https://git.kernel.org/broonie/sound/c/802d0d6c25b3 [06/14] ASoC: tegra: Add error logging in tegra210_amx driver https://git.kernel.org/broonie/sound/c/d310c08db2d8 [07/14] ASoC: tegra: Use dev_err_probe() in tegra210_dmic probe https://git.kernel.org/broonie/sound/c/ca069c3403ec [08/14] ASoC: tegra: Add error logging in tegra210_i2s driver https://git.kernel.org/broonie/sound/c/67b7bcdd9798 [10/14] ASoC: tegra: Use dev_err_probe() in tegra210_mixer probe https://git.kernel.org/broonie/sound/c/3d027d4b93b9 [11/14] ASoC: tegra: Use dev_err_probe() in tegra210_mvc probe https://git.kernel.org/broonie/sound/c/f2067c1dba07 [12/14] ASoC: tegra: Use dev_err_probe() in tegra210_sfc probe https://git.kernel.org/broonie/sound/c/856ffd8f4aae [13/14] ASoC: tegra: Use dev_err_probe() in tegra_asoc_machine probe https://git.kernel.org/broonie/sound/c/fa11e1cb2b77 [14/14] ASoC: tegra: Use dev_err_probe() in tegra_audio_graph_card probe https://git.kernel.org/broonie/sound/c/f7d9eb0291ef
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark