Skip to contentSkip to conversation

intel_sst: fix comment typo

PATCH Applied Lu Guanqun 4 participants 8 messages Sep 6, 2011 – Sep 8, 2011

Subsystems (3)
lore
Share & tools
lore

Lu Guanqun

author
#0 lore raw

PATCH 1/4 intel_sst: fix comment typo

---
 drivers/staging/intel_sst/intel_sst_dsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/intel_sst/intel_sst_dsp.c +1 -1
index a89e1ad..426d2b9 100644
@@ -104,7 +104,7 @@ static int sst_start_mrst(void)
 /**
  * sst_start_medfield - Start the SST DSP processor
  *
- * This starts the DSP in MRST platfroms
+ * This starts the DSP in Medfield platfroms
  */
 static int sst_start_medfield(void)
 {
author
#1 lore raw

PATCH 2/4 ASoC: sst_platform: trivial coding style fix

---
 sound/soc/mid-x86/sst_platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/mid-x86/sst_platform.c +1 -1
index 3e78260..d99f253 100644
@@ -469,7 +469,7 @@ static struct platform_driver sst_platform_driver = {
 static int __init sst_soc_platform_init(void)
 {
 	pr_debug("sst_soc_platform_init called\n");
-	return  platform_driver_register(&sst_platform_driver);
+	return platform_driver_register(&sst_platform_driver);
 }
 module_init(sst_soc_platform_init);
 
author
#2 lore raw

PATCH 3/4 ASoC: sst_platform: using builtin function

In reply to Lu Guanqun

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

---
 sound/soc/mid-x86/sst_platform.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/mid-x86/sst_platform.c +4 -3
index d99f253..af666ae 100644
@@ -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;
author
#3 lore raw

PATCH 4/4 ASoC: sst_platform: fix memory leak

In reply to Lu Guanqun

snd_pcm_hw_constraint_integer() could return -1, in this case, sst platform is not opened successfully. However the corresponding close callback isn't able to be called later on to release these two allocated memories, thus resulting in memory leak.

This patch moves the check for hardware contraints earlier, thus resolving this issue.

---
 sound/soc/mid-x86/sst_platform.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
sound/soc/mid-x86/sst_platform.c +6 -2
index af666ae..9925d20 100644
@@ -233,6 +233,10 @@ static int sst_platform_open(struct snd_pcm_substream *substream)
 	pr_debug("sst_platform_open called\n");
 
 	snd_soc_set_runtime_hwparams(substream, &sst_platform_pcm_hw);
+	ret_val = snd_pcm_hw_constraint_integer(runtime,
+						SNDRV_PCM_HW_PARAM_PERIODS);
+	if (ret_val < 0)
+		return ret_val;
 
 	stream = kzalloc(sizeof(*stream), GFP_KERNEL);
 	if (!stream)
@@ -260,8 +264,8 @@ static int sst_platform_open(struct snd_pcm_substream *substream)
 		return ret_val;
 	}
 	runtime->private_data = stream;
-	return snd_pcm_hw_constraint_integer(runtime,
-			 SNDRV_PCM_HW_PARAM_PERIODS);
+
+	return 0;
 }
 
 static int sst_platform_close(struct snd_pcm_substream *substream)
#4 lore raw
In reply to Lu Guanqun
Quoted 13 lines
---
 drivers/staging/intel_sst/intel_sst_dsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/intel_sst/intel_sst_dsp.c +0 -0
index a89e1ad..426d2b9 100644

drivers/staging/intel_sst/intel_sst_dsp.c static int sst_start_mrst(void) · line 110

Quoted 8 lines
drivers/staging/intel_sst/intel_sst_dsp.c +1 -1
@@ -104,7 +104,7 @@ static int sst_start_mrst(void)
 /**
  * sst_start_medfield - Start the SST DSP processor
  *
- * This starts the DSP in MRST platfroms
+ * This starts the DSP in Medfield platfroms
  */
 static int sst_start_medfield(void)
 {

All Acked-by: Vinod Koul <[email protected]>

You should be CCing Liam as well on asoc patches

--
~Vinod

author
#5 lore raw
Quoted 7 lines · Vinod
Quoted 7 lines
---
 drivers/staging/intel_sst/intel_sst_dsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines
Quoted 6 lines
drivers/staging/intel_sst/intel_sst_dsp.c +0 -0
index a89e1ad..426d2b9 100644

drivers/staging/intel_sst/intel_sst_dsp.c static int sst_start_mrst(void) · line 110

Quoted 8 lines
drivers/staging/intel_sst/intel_sst_dsp.c +1 -1
@@ -104,7 +104,7 @@ static int sst_start_mrst(void)
 /**
  * sst_start_medfield - Start the SST DSP processor
  *
- * This starts the DSP in MRST platfroms
+ * This starts the DSP in Medfield platfroms
  */
 static int sst_start_medfield(void)
 {

All Acked-by: Vinod Koul <[email protected]>

Thanks.

Quoted 2 lines

You should be CCing Liam as well on asoc patches

I forgot to add Liam, will remember to add for later patches.

Quoted 4 lines

--
~Vinod

Signature · 1 line
guanqun
#6 lore raw
Quoted 32 lines · Lu Guanqun
Quoted 7 lines · Vinod
Quoted 7 lines
---
 drivers/staging/intel_sst/intel_sst_dsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines
Quoted 6 lines
drivers/staging/intel_sst/intel_sst_dsp.c +0 -0
index a89e1ad..426d2b9 100644

drivers/staging/intel_sst/intel_sst_dsp.c static int sst_start_mrst(void) · line 110

Quoted 8 lines
drivers/staging/intel_sst/intel_sst_dsp.c +1 -1
@@ -104,7 +104,7 @@ static int sst_start_mrst(void)
 /**
  * sst_start_medfield - Start the SST DSP processor
  *
- * This starts the DSP in MRST platfroms
+ * This starts the DSP in Medfield platfroms
  */
 static int sst_start_medfield(void)
 {

All Acked-by: Vinod Koul <[email protected]>

Thanks.

Quoted 2 lines

You should be CCing Liam as well on asoc patches

I forgot to add Liam, will remember to add for later patches.

Quoted 1 line
Quoted 7 lines
Quoted 3 lines

--
~Vinod

--
guanqun

Fine by me.

Acked-by Liam Girdwood <[email protected]>

Acked-by Vinod Koul Acked-by Liam Girdwood Acked-by on v1 1/4 Applied
#7 lore raw
In reply to Lu Guanqun
Quoted 5 lines · Lu Guanqun
---
 drivers/staging/intel_sst/intel_sst_dsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

This is a staging driver - patches should go via Greg (who I've added here) to avoid collisions with other staging work. This has:

I've applied the other three patches, thanks.

Quoted 15 lines
drivers/staging/intel_sst/intel_sst_dsp.c +1 -1
index a89e1ad..426d2b9 100644
@@ -104,7 +104,7 @@ static int sst_start_mrst(void)
 /**
  * sst_start_medfield - Start the SST DSP processor
  *
- * This starts the DSP in MRST platfroms
+ * This starts the DSP in Medfield platfroms
  */
 static int sst_start_medfield(void)
 {