[alsa-devel] [PATCH 2/2] ASoC: io: Remove reduntant params of snd_soc_codec_set_cache_io()

Li.Xiubo at freescale.com Li.Xiubo at freescale.com
Fri Feb 28 09:50:36 CET 2014


> [...]
> > @@ -118,7 +115,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec
> *codec,
> >   EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);
> >   #else
> >   int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
> > -			       int addr_bits, int data_bits,
> >   			       enum snd_soc_control_type control)
> 
> Since the only control type that is left is SND_SOC_REGMAP that can be
> removed as well. And while you are at it I think we should make it possible

Yes, agree.

> to specify the regmap struct as a parameter to snd_soc_codec_set_cache_io().
> So basically the new signature of the function should be:
> 
> snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, struct regmap *regmap)
>
> if regmap is NULL the function should use dev_get_regmap(), otherwise use
> the supplied regmap struct. This turns the two step initialization in the
> form of
> 
> 	codec->control_data = priv->regmap;
> 	snd_soc_codec_set_cache_io(codec, ...);
> 
> into
> 	snd_soc_codec_set_cache_io(codec, priv->regmap);
> 
> which is much nicer in my opinion.
> 
> - Lars
> 

That's a good idea, I'll try to implement it.

Thanks,

--
Best Regards,
Xiubo

 



More information about the Alsa-devel mailing list