diff options
Diffstat (limited to 'sound/soc/mid-x86/sst_platform.c')
-rw-r--r-- | sound/soc/mid-x86/sst_platform.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c index 3e7826058efe..9925d20ab0a3 100644 --- a/sound/soc/mid-x86/sst_platform.c +++ b/sound/soc/mid-x86/sst_platform.c @@ -226,13 +226,18 @@ 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); + 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) return -ENOMEM; @@ -259,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) @@ -469,7 +474,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); |