kconfig: fix default value for choice input
[pandora-kernel.git] / sound / drivers / serial-u16550.c
index 29676d8..1a7fbef 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,8 +990,10 @@ 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)) {