ASoC/mpc5200: Track DMA position by period number instead of bytes
[safe/jmp/linux-2.6] / sound / soc / codecs / wm8400.c
index 502eefa..584af68 100644 (file)
@@ -1011,7 +1011,8 @@ static int fll_factors(struct wm8400_priv *wm8400, struct fll_factors *factors,
 }
 
 static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
-                             unsigned int freq_in, unsigned int freq_out)
+                             int source, unsigned int freq_in,
+                             unsigned int freq_out)
 {
        struct snd_soc_codec *codec = codec_dai->codec;
        struct wm8400_priv *wm8400 = codec->private_data;
@@ -1022,10 +1023,15 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
        if (freq_in == wm8400->fll_in && freq_out == wm8400->fll_out)
                return 0;
 
-       if (freq_out != 0) {
+       if (freq_out) {
                ret = fll_factors(wm8400, &factors, freq_in, freq_out);
                if (ret != 0)
                        return ret;
+       } else {
+               /* Bodge GCC 4.4.0 uninitialised variable warning - it
+                * doesn't seem capable of working out that we exit if
+                * freq_out is 0 before any of the uses. */
+               memset(&factors, 0, sizeof(factors));
        }
 
        wm8400->fll_out = freq_out;
@@ -1040,7 +1046,7 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
        reg &= ~WM8400_FLL_OSC_ENA;
        wm8400_write(codec, WM8400_FLL_CONTROL_1, reg);
 
-       if (freq_out == 0)
+       if (!freq_out)
                return 0;
 
        reg &= ~(WM8400_FLL_REF_FREQ | WM8400_FLL_FRATIO_MASK);
@@ -1394,17 +1400,6 @@ static int wm8400_probe(struct platform_device *pdev)
        wm8400_add_controls(codec);
        wm8400_add_widgets(codec);
 
-       ret = snd_soc_init_card(socdev);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "failed to register card\n");
-               goto card_err;
-       }
-
-       return ret;
-
-card_err:
-       snd_soc_free_pcms(socdev);
-       snd_soc_dapm_free(socdev);
 pcm_err:
        return ret;
 }