summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/skl_nau88l25_max98357a.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart2017-10-13 01:38:03 +0200
committerMark Brown2017-10-18 13:30:22 +0200
commitdfb6ec7ae57d33d2854a1af2dfe1278da8a7dedc (patch)
treeb64951eafd270114b0e1cf9674058d1b3f4bb0b6 /sound/soc/intel/boards/skl_nau88l25_max98357a.c
parentASoC: Intel: bytcht_es8316: remove useless code (diff)
downloadkernel-qcow2-linux-dfb6ec7ae57d33d2854a1af2dfe1278da8a7dedc.tar.gz
kernel-qcow2-linux-dfb6ec7ae57d33d2854a1af2dfe1278da8a7dedc.tar.xz
kernel-qcow2-linux-dfb6ec7ae57d33d2854a1af2dfe1278da8a7dedc.zip
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/skl_nau88l25_max98357a.c')
-rw-r--r--sound/soc/intel/boards/skl_nau88l25_max98357a.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
index 5ed0aa27b467..1b5a689dc99b 100644
--- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c
+++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
@@ -54,20 +54,6 @@ enum {
SKL_DPCM_AUDIO_HDMI3_PB,
};
-static inline struct snd_soc_dai *skl_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, SKL_NUVOTON_CODEC_DAI,
- strlen(SKL_NUVOTON_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)
{
@@ -76,7 +62,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
struct snd_soc_dai *codec_dai;
int ret;
- codec_dai = skl_get_codec_dai(card);
+ codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI);
if (!codec_dai) {
dev_err(card->dev, "Codec dai not found; Unable to set platform clock\n");
return -EIO;