[alsa-devel] [PATCH] ASoC: Report error code when failing to add controls

Liam Girdwood lrg at slimlogic.co.uk
Tue Sep 21 15:06:43 CEST 2010


On Mon, 2010-09-20 at 19:15 +0100, Mark Brown wrote:
> Helps with diagnostics.
> 
> Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
> ---
>  sound/soc/soc-core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 8d8c5cd..7c64e03 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1983,8 +1983,8 @@ int snd_soc_add_controls(struct snd_soc_codec *codec,
>  		const struct snd_kcontrol_new *control = &controls[i];
>  		err = snd_ctl_add(card, snd_soc_cnew(control, codec, NULL));
>  		if (err < 0) {
> -			dev_err(codec->dev, "%s: Failed to add %s\n",
> -				codec->name, control->name);
> +			dev_err(codec->dev, "%s: Failed to add %s: %d\n",
> +				codec->name, control->name, err);
>  			return err;
>  		}
>  	}

Acked-by: Liam Girdwood <lrg at slimlogic.co.uk>

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk



More information about the Alsa-devel mailing list