Re: [alsa-devel] [PATCH 2/2] ASoC: io: Remove reduntant params of snd_soc_codec_set_cache_io()
From: Lars-Peter Clausen
Date: Fri Feb 28 2014 - 03:25:53 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/