Skip to content

Commit

Permalink
ASoC: io: Use dev_get_regmap() if driver doesn't provide a regmap
Browse files Browse the repository at this point in the history
Less error prone and one less line of code in drivers.

Signed-off-by: Mark Brown <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
  • Loading branch information
broonie committed Jun 3, 2012
1 parent 51cc7ed commit 210cb67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/soc-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 210cb67

Please sign in to comment.