sound: add moduleparam.h to users of module_param/MODULE_PARM_DESC
[deliverable/linux.git] / sound / soc / mid-x86 / sst_platform.c
index 3e7826058efe61375b1fa938e1569cea87d7a21e..7df8c58ba50ae3ae0015e3f7cb915049a71cfb5c 100644 (file)
@@ -63,7 +63,7 @@ static struct snd_pcm_hardware sst_platform_pcm_hw = {
 };
 
 /* MFLD - MSIC */
-struct snd_soc_dai_driver sst_platform_dai[] = {
+static struct snd_soc_dai_driver sst_platform_dai[] = {
 {
        .name = "Headset-cpu-dai",
        .id = 0,
@@ -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);
 
This page took 0.025844 seconds and 5 git commands to generate.