Merge remote-tracking branches 'asoc/fix/compress', 'asoc/fix/core', 'asoc/fix/dapm...
[sfrench/cifs-2.6.git] / sound / soc / soc-compress.c
index d9b1e64..7973f92 100644 (file)
@@ -944,7 +944,7 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
        struct snd_soc_platform *platform = rtd->platform;
        struct snd_soc_component *component;
        struct snd_soc_rtdcom_list *rtdcom;
-       int ret = 0, __ret;
+       int ret = 0;
 
        mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
 
@@ -965,10 +965,10 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
                    !component->driver->compr_ops->copy)
                        continue;
 
-               __ret = component->driver->compr_ops->copy(cstream, buf, count);
-               if (__ret < 0)
-                       ret = __ret;
+               ret = component->driver->compr_ops->copy(cstream, buf, count);
+               break;
        }
+
 err:
        mutex_unlock(&rtd->pcm_mutex);
        return ret;
@@ -1096,7 +1096,6 @@ static struct snd_compr_ops soc_compr_dyn_ops = {
  */
 int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
 {
-       struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_platform *platform = rtd->platform;
        struct snd_soc_component *component;
        struct snd_soc_rtdcom_list *rtdcom;
@@ -1199,8 +1198,9 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
        ret = snd_compress_new(rtd->card->snd_card, num, direction,
                                new_name, compr);
        if (ret < 0) {
+               component = rtd->codec_dai->component;
                pr_err("compress asoc: can't create compress for codec %s\n",
-                       codec->component.name);
+                       component->name);
                goto compr_err;
        }