[alsa-devel] [PATCH 3/4] ASoC: sst_platform: using builtin function

Lu Guanqun guanqun.lu at intel.com
Tue Sep 6 09:21:38 CEST 2011


Use the builtin snd_soc_set_runtime_hwparams() instead of assigning it by
myself.

Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
Cc: Vinod Koul <vinod.koul at intel.com>
---
 sound/soc/mid-x86/sst_platform.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
index d99f253..af666ae 100644
--- a/sound/soc/mid-x86/sst_platform.c
+++ b/sound/soc/mid-x86/sst_platform.c
@@ -226,13 +226,14 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream)
 
 static int sst_platform_open(struct snd_pcm_substream *substream)
 {
-	struct snd_pcm_runtime *runtime;
+	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct sst_runtime_stream *stream;
 	int ret_val = 0;
 
 	pr_debug("sst_platform_open called\n");
-	runtime = substream->runtime;
-	runtime->hw = sst_platform_pcm_hw;
+
+	snd_soc_set_runtime_hwparams(substream, &sst_platform_pcm_hw);
+
 	stream = kzalloc(sizeof(*stream), GFP_KERNEL);
 	if (!stream)
 		return -ENOMEM;



More information about the Alsa-devel mailing list