提交 210cb67c 编写于 作者: M Mark Brown

ASoC: io: Use dev_get_regmap() if driver doesn't provide a regmap

Less error prone and one less line of code in drivers.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NLiam Girdwood <lrg@ti.com>
上级 51cc7ed3
...@@ -142,6 +142,8 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, ...@@ -142,6 +142,8 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
case SND_SOC_REGMAP: case SND_SOC_REGMAP:
/* Device has made its own regmap arrangements */ /* Device has made its own regmap arrangements */
codec->using_regmap = true; codec->using_regmap = true;
if (!codec->control_data)
codec->control_data = dev_get_regmap(codec->dev, NULL);
ret = regmap_get_val_bytes(codec->control_data); ret = regmap_get_val_bytes(codec->control_data);
/* Errors are legitimate for non-integer byte multiples */ /* Errors are legitimate for non-integer byte multiples */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册