lkml.org 
[lkml]   [2014]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel] [PATCH 2/2] ASoC: io: Remove reduntant params of snd_soc_codec_set_cache_io()
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



\
 
 \ /
  Last update: 2014-02-28 10:01    [W:0.038 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site