]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/drivers/serial-u16550.c
Merge branch 'for-jeff' of git://htj.dyndns.org/libata-tj into tejun-merge
[linux-2.6-omap-h63xx.git] / sound / drivers / serial-u16550.c
index 29676d800cae163dd3a14216ed4a3a25d39f7dba..c01b4c5118b909b1555d8b7e3c8147468ef393f2 100644 (file)
@@ -789,7 +789,8 @@ static int __init snd_uart16550_create(struct snd_card *card,
 
        if ((err = snd_uart16550_detect(uart)) <= 0) {
                printk(KERN_ERR "no UART detected at 0x%lx\n", iobase);
-               return err;
+               snd_uart16550_free(uart);
+               return -ENODEV;
        }
 
        if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
@@ -989,14 +990,14 @@ static int __init alsa_card_serial_init(void)
                return err;
 
        cards = 0;
-       for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+       for (i = 0; i < SNDRV_CARDS; i++) {
                struct platform_device *device;
+               if (! enable[i])
+                       continue;
                device = platform_device_register_simple(SND_SERIAL_DRIVER,
                                                         i, NULL, 0);
-               if (IS_ERR(device)) {
-                       err = PTR_ERR(device);
-                       goto errout;
-               }
+               if (IS_ERR(device))
+                       continue;
                devices[i] = device;
                cards++;
        }
@@ -1004,14 +1005,10 @@ static int __init alsa_card_serial_init(void)
 #ifdef MODULE
                printk(KERN_ERR "serial midi soundcard not found or device busy\n");
 #endif
-               err = -ENODEV;
-               goto errout;
+               snd_serial_unregister_all();
+               return -ENODEV;
        }
        return 0;
-
- errout:
-       snd_serial_unregister_all();
-       return err;
 }
 
 static void __exit alsa_card_serial_exit(void)