[alsa-devel] [PATCH 3/7] ASoC: dapm: Move error handling to snd_soc_dapm_new_control_unlocked

Mark Brown broonie at kernel.org
Tue Aug 28 20:28:26 CEST 2018


On Tue, Aug 28, 2018 at 02:35:04PM +0100, Charles Keepax wrote:
> Currently DAPM has almost identical code to handle errors from
> snd_soc_dapm_new_control_unlocked in many places. Centralise
> this handling within snd_soc_dapm_new_control_unlocked and
> remove the duplicated error reporting. This also has the fringe
> benefit of removing a lot of error messages that would have
> been printed on the -ENOMEM paths.

This changelog doesn't entirely match up with the change:

>  			}
> -			if (!data->widget) {
> -				ret = -ENOMEM;
> -				goto err_data;
> -			}
>  		}

and

>  	w = snd_soc_dapm_new_control_unlocked(dapm, widget);
> -	/* Do not nag about probe deferrals */
> -	if (IS_ERR(w)) {
> -		int ret = PTR_ERR(w);
> -
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dapm->dev,
> -				"ASoC: Failed to create DAPM control %s (%d)\n",
> -				widget->name, ret);
> -		goto out_unlock;
> -	}
> -	if (!w)
> -		dev_err(dapm->dev,
> -			"ASoC: Failed to create DAPM control %s\n",
> -			widget->name);
> -
> -out_unlock:
>  	mutex_unlock(&dapm->card->dapm_mutex);
> +
>  	return w;

are not obviously identical.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180828/71b6eba1/attachment.sig>


More information about the Alsa-devel mailing list