From: Mark Brown Date: Tue, 8 May 2012 16:46:36 +0000 (+0100) Subject: ASoC: io: Use dev_get_regmap() if driver doesn't provide a regmap X-Git-Tag: v3.6-rc1~17^2~11^2~122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=210cb67cb5b9f9a23b7ce91de50bab357440ba9d;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 4d8dc6a..44d0174 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 */