]> err.no Git - linux-2.6/blobdiff - sound/drivers/dummy.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
[linux-2.6] / sound / drivers / dummy.c
index e35fd5779a9d7b9e65025df4e6622fed24390ca9..ffeafaf2eccae64956ac2bfd8034257fbb10b92c 100644 (file)
@@ -675,9 +675,11 @@ static int __init alsa_card_dummy_init(void)
                        continue;
                device = platform_device_register_simple(SND_DUMMY_DRIVER,
                                                         i, NULL, 0);
-               if (IS_ERR(device)) {
-                       err = PTR_ERR(device);
-                       goto errout;
+               if (IS_ERR(device))
+                       continue;
+               if (!platform_get_drvdata(device)) {
+                       platform_device_unregister(device);
+                       continue;
                }
                devices[i] = device;
                cards++;
@@ -686,14 +688,10 @@ static int __init alsa_card_dummy_init(void)
 #ifdef MODULE
                printk(KERN_ERR "Dummy soundcard not found or device busy\n");
 #endif
-               err = -ENODEV;
-               goto errout;
+               snd_dummy_unregister_all();
+               return -ENODEV;
        }
        return 0;
-
- errout:
-       snd_dummy_unregister_all();
-       return err;
 }
 
 static void __exit alsa_card_dummy_exit(void)