[alsa-devel] [PATCH 1/4] intel_sst: fix comment typo
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com --- drivers/staging/intel_sst/intel_sst_dsp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intel_sst_dsp.c b/drivers/staging/intel_sst/intel_sst_dsp.c index a89e1ad..426d2b9 100644 --- a/drivers/staging/intel_sst/intel_sst_dsp.c +++ b/drivers/staging/intel_sst/intel_sst_dsp.c @@ -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) {
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com --- sound/soc/mid-x86/sst_platform.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index 3e78260..d99f253 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c @@ -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);
Use the builtin snd_soc_set_runtime_hwparams() instead of assigning it by myself.
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@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;
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.
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com --- sound/soc/mid-x86/sst_platform.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index af666ae..9925d20 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c @@ -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)
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com
drivers/staging/intel_sst/intel_sst_dsp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intel_sst_dsp.c b/drivers/staging/intel_sst/intel_sst_dsp.c index a89e1ad..426d2b9 100644 --- a/drivers/staging/intel_sst/intel_sst_dsp.c +++ b/drivers/staging/intel_sst/intel_sst_dsp.c @@ -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 Vinod.koul@linux.intel.com
You should be CCing Liam as well on asoc patches
-- ~Vinod
On Wed, Sep 07, 2011 at 08:39:06AM +0800, Koul, Vinod wrote:
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com
drivers/staging/intel_sst/intel_sst_dsp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intel_sst_dsp.c b/drivers/staging/intel_sst/intel_sst_dsp.c index a89e1ad..426d2b9 100644 --- a/drivers/staging/intel_sst/intel_sst_dsp.c +++ b/drivers/staging/intel_sst/intel_sst_dsp.c @@ -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 Vinod.koul@linux.intel.com
Thanks.
You should be CCing Liam as well on asoc patches
I forgot to add Liam, will remember to add for later patches.
-- ~Vinod
On 7 September 2011 01:52, Lu Guanqun guanqun.lu@intel.com wrote:
On Wed, Sep 07, 2011 at 08:39:06AM +0800, Koul, Vinod wrote:
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com
drivers/staging/intel_sst/intel_sst_dsp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/intel_sst/intel_sst_dsp.c b/drivers/staging/intel_sst/intel_sst_dsp.c index a89e1ad..426d2b9 100644 --- a/drivers/staging/intel_sst/intel_sst_dsp.c +++ b/drivers/staging/intel_sst/intel_sst_dsp.c @@ -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 Vinod.koul@linux.intel.com
Thanks.
You should be CCing Liam as well on asoc patches
I forgot to add Liam, will remember to add for later patches.
-- ~Vinod
-- guanqun
Fine by me.
Acked-by Liam Girdwood lrg@ti.com
On Tue, Sep 06, 2011 at 03:21:29PM +0800, Lu Guanqun wrote:
Signed-off-by: Lu Guanqun guanqun.lu@intel.com Cc: Vinod Koul vinod.koul@intel.com
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:
Acked-by: Vinod Koul vinod.koul@intel.com Acked-by: Liam Girdwood lrg@ti.com Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com
I've applied the other three patches, thanks.
diff --git a/drivers/staging/intel_sst/intel_sst_dsp.c b/drivers/staging/intel_sst/intel_sst_dsp.c index a89e1ad..426d2b9 100644 --- a/drivers/staging/intel_sst/intel_sst_dsp.c +++ b/drivers/staging/intel_sst/intel_sst_dsp.c @@ -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) {
participants (4)
-
Girdwood, Liam
-
Koul, Vinod
-
Lu Guanqun
-
Mark Brown