X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fdrivers%2Fserial-u16550.c;h=c01b4c5118b909b1555d8b7e3c8147468ef393f2;hb=efa6e7e9d40fe01406d889a5bed62f2e0da49bff;hp=13b46d12564aae174a025f76b665c3e0b543946f;hpb=8278ca8feb2748cf02d756ac6c5b9ab2e047c84a;p=linux-2.6-omap-h63xx.git diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 13b46d12564..c01b4c5118b 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -789,6 +789,7 @@ 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); + snd_uart16550_free(uart); return -ENODEV; } @@ -995,10 +996,8 @@ static int __init alsa_card_serial_init(void) 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++; } @@ -1006,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)