diff mbox

[RFT,v3,2/3] ASoC: core: Add one dai_get_widget helper instead of two rtd based ones

Message ID 1398340906-5017-3-git-send-email-bcousson@baylibre.com (mailing list archive)
State Accepted
Commit 370186106075143f6e9336a4c3d9650cbf162617
Headers show

Commit Message

Benoit Cousson April 24, 2014, 12:01 p.m. UTC
Replace rtd_get_codec_widget() and rtd_get_cpu_widget() by a simple
dai_get_widget() in preparation for DAI-multicodec support, per Lars
suggestion.

No functional change.

Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-pcm.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

Comments

Mark Brown April 24, 2014, 12:25 p.m. UTC | #1
On Thu, Apr 24, 2014 at 02:01:45PM +0200, Benoit Cousson wrote:
> Replace rtd_get_codec_widget() and rtd_get_cpu_widget() by a simple
> dai_get_widget() in preparation for DAI-multicodec support, per Lars
> suggestion.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2cedf09..88230ea 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1012,21 +1012,12 @@  static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card,
 }
 
 static inline struct snd_soc_dapm_widget *
-	rtd_get_cpu_widget(struct snd_soc_pcm_runtime *rtd, int stream)
+	dai_get_widget(struct snd_soc_dai *dai, int stream)
 {
 	if (stream == SNDRV_PCM_STREAM_PLAYBACK)
-		return rtd->cpu_dai->playback_widget;
+		return dai->playback_widget;
 	else
-		return rtd->cpu_dai->capture_widget;
-}
-
-static inline struct snd_soc_dapm_widget *
-	rtd_get_codec_widget(struct snd_soc_pcm_runtime *rtd, int stream)
-{
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK)
-		return rtd->codec_dai->playback_widget;
-	else
-		return rtd->codec_dai->capture_widget;
+		return dai->capture_widget;
 }
 
 static int widget_in_list(struct snd_soc_dapm_widget_list *list,
@@ -1076,14 +1067,14 @@  static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
 	list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) {
 
 		/* is there a valid CPU DAI widget for this BE */
-		widget = rtd_get_cpu_widget(dpcm->be, stream);
+		widget = dai_get_widget(dpcm->be->cpu_dai, stream);
 
 		/* prune the BE if it's no longer in our active list */
 		if (widget && widget_in_list(list, widget))
 			continue;
 
 		/* is there a valid CODEC DAI widget for this BE */
-		widget = rtd_get_codec_widget(dpcm->be, stream);
+		widget = dai_get_widget(dpcm->be->codec_dai, stream);
 
 		/* prune the BE if it's no longer in our active list */
 		if (widget && widget_in_list(list, widget))