summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-io.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-08 17:46:36 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-03 13:06:41 +0100
commit210cb67cb5b9f9a23b7ce91de50bab357440ba9d (patch)
treeaecabeefa9269d385583b0aa2a54e6a7eac362f1 /sound/soc/soc-io.c
parent51cc7ed3e378a60a3413a7e424f536e4dec3f39d (diff)
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: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-io.c')
-rw-r--r--sound/soc/soc-io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 4d8dc6a27d4..44d0174b4d9 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -142,6 +142,8 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
case SND_SOC_REGMAP:
/* Device has made its own regmap arrangements */
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);
/* Errors are legitimate for non-integer byte multiples */