diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2017-10-12 18:38:03 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-10-18 12:30:22 +0100 |
commit | dfb6ec7ae57d33d2854a1af2dfe1278da8a7dedc (patch) | |
tree | b64951eafd270114b0e1cf9674058d1b3f4bb0b6 /sound/soc/intel/boards/cht_bsw_max98090_ti.c | |
parent | 8a2eca50c618ef2affc140b38dc7fdc63d423e89 (diff) |
ASoC: Intel: boards: use helper to get codec_dai
Remove duplicate code with a common helper in all Intel machine drivers.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/cht_bsw_max98090_ti.c')
-rw-r--r-- | sound/soc/intel/boards/cht_bsw_max98090_ti.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index a23eba7bb056..c2e3b00ec89d 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -41,18 +41,6 @@ struct cht_mc_private { bool ts3a227e_present; }; -static inline struct snd_soc_dai *cht_get_codec_dai(struct snd_soc_card *card) -{ - struct snd_soc_pcm_runtime *rtd; - - list_for_each_entry(rtd, &card->rtd_list, list) { - if (!strncmp(rtd->codec_dai->name, CHT_CODEC_DAI, - strlen(CHT_CODEC_DAI))) - return rtd->codec_dai; - } - return NULL; -} - static int platform_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { @@ -62,7 +50,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card); int ret; - codec_dai = cht_get_codec_dai(card); + codec_dai = snd_soc_card_get_codec_dai(card, CHT_CODEC_DAI); if (!codec_dai) { dev_err(card->dev, "Codec dai not found; Unable to set platform clock\n"); return -EIO; |