X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=sound%2Fisa%2Fad1848%2Fad1848.c;h=99908e44124da32593b6fa85ea87eafeb4cc1c6b;hb=68a696a01f482859a9fe937249e8b3d44252b610;hp=326a057f752ff7c4d8dd2fcc8ba878e033d6608a;hpb=11ed56fb7899f9eb9eaef8e5919db1bf08f1b07e;p=~andy%2Flinux diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 326a057f752..99908e44124 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c @@ -193,9 +193,11 @@ static int __init alsa_card_ad1848_init(void) continue; device = platform_device_register_simple(SND_AD1848_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++; @@ -204,14 +206,10 @@ static int __init alsa_card_ad1848_init(void) #ifdef MODULE printk(KERN_ERR "AD1848 soundcard not found or device busy\n"); #endif - err = -ENODEV; - goto errout; + snd_ad1848_unregister_all(); + return -ENODEV; } return 0; - - errout: - snd_ad1848_unregister_all(); - return err; } static void __exit alsa_card_ad1848_exit(void)