[PATCH 01/16] ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()

Kai Vehmanen kai.vehmanen at linux.intel.com
Mon Jun 22 14:01:37 CEST 2020


Hello, 

On Tue, 16 Jun 2020, Kuninori Morimoto wrote:

> This patch do
> 	1) merge snd_soc_component_read() and snd_soc_component_read32()
> 	2) it uses soc_component_err() when error case (easy to notice)
> 	3) keeps read32 for now by #define
> 	4) update snd_soc_component_read() for all drivers

removing the possibility to return errors is a bit iffy, but reviewing
the existing usage, indeed in practise it is not much used.

And on the other side, having two component_read() variants with different 
style and overlapping usage, in soc-component.h, is very confusing, so 
this patch does clean up the component interface. So all in all, my 
++votes for the change.

I spotted one minor whitespace issue, but that's trivial, so for
the patch:
Reviewed-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>

> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -616,12 +616,11 @@ static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm)
>  	return dapm->component->name_prefix;
>  }
>  
> -static int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg,
> -	unsigned int *value)
> +static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg)
>  {
>  	if (!dapm->component)
>  		return -EIO;
> -	return snd_soc_component_read(dapm->component, reg, value);
> +	return  snd_soc_component_read(dapm->component, reg);

Trivial but you have extra whitespace there after return.

Br, Kai


More information about the Alsa-devel mailing list