]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/soc/soc-core.c
Merge branch 'topic/snd_card_new-err' into topic/asoc
[linux-2.6-omap-h63xx.git] / sound / soc / soc-core.c
index f18c7a3e36d1dfb3194cf45b143911ec613b1626..580a1a534ad03a4e72571e611870d5fcf8570be3 100644 (file)
@@ -1308,17 +1308,17 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
 {
        struct snd_soc_card *card = socdev->card;
        struct snd_soc_codec *codec = card->codec;
-       int ret = 0, i;
+       int ret, i;
 
        mutex_lock(&codec->mutex);
 
        /* register a sound card */
-       codec->card = snd_card_new(idx, xid, codec->owner, 0);
-       if (!codec->card) {
+       ret = snd_card_create(idx, xid, codec->owner, 0, &codec->card);
+       if (ret < 0) {
                printk(KERN_ERR "asoc: can't create sound card for codec %s\n",
                        codec->name);
                mutex_unlock(&codec->mutex);
-               return -ENODEV;
+               return ret;
        }
 
        codec->card->dev = socdev->dev;