X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fisa%2Fcs423x%2Fcs4231.c;h=696a5c86bcfae7c60f51e1e4dfd01355f7ff9283;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=ab67b5c2590d97afa6afc9e538a333f02fa19fe3;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index ab67b5c25..696a5c86b 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c @@ -122,7 +122,7 @@ static int __init snd_cs4231_probe(struct platform_device *pdev) if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, mpu_port[dev], 0, mpu_irq[dev], - mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0, + mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL) < 0) printk(KERN_WARNING "cs4231: MPU401 not detected\n"); } @@ -203,13 +203,17 @@ static int __init alsa_card_cs4231_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_CS4231_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++; @@ -218,14 +222,10 @@ static int __init alsa_card_cs4231_init(void) #ifdef MODULE printk(KERN_ERR "CS4231 soundcard not found or device busy\n"); #endif - err = -ENODEV; - goto errout; + snd_cs4231_unregister_all(); + return -ENODEV; } return 0; - - errout: - snd_cs4231_unregister_all(); - return err; } static void __exit alsa_card_cs4231_exit(void)