[alsa-devel] [PATCH 2/2] ASoC: io: Remove reduntant params of snd_soc_codec_set_cache_io()
Lars-Peter Clausen
lars at metafoo.de
Fri Feb 28 09:26:05 CET 2014
On 02/28/2014 06:06 AM, Xiubo Li wrote:
[...]
> @@ -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
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
More information about the Alsa-devel
mailing list