diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-05 17:19:20 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 10:42:01 +0200 |
commit | 43bcd973d6d05d16b876e09dcc49a09d3e48e88d (patch) | |
tree | 8c8493b66c417402f6188051c57e55099bbd156d /sound/isa/cs423x/cs4231.c | |
parent | 16dab54b8cbac39bd3f639db5d7d0fd8300a6cb0 (diff) | |
download | op-kernel-dev-43bcd973d6d05d16b876e09dcc49a09d3e48e88d.zip op-kernel-dev-43bcd973d6d05d16b876e09dcc49a09d3e48e88d.tar.gz |
[ALSA] Add snd_card_set_generic_dev() call to ISA drivers
ISA,CMI8330 driver,ES18xx driver,OPL3SA2 driver,Sound Galaxy driver
Sound Scape driver,AD1848 driver,CS4231 driver,CS4236+ driver
ES1688 driver,GUS Classic driver,GUS Extreme driver,GUS MAX driver
AMD InterWave driver,Opti9xx drivers,SB16/AWE driver,SB8 driver
Wavefront drivers
- Added snd_card_set_generic_dev() call.
- Added SND_GENERIC_DRIVER to Kconfig.
- Clean up the error path in probe if necessary.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/cs423x/cs4231.c')
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index 7640837..9be5416 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c @@ -76,15 +76,15 @@ static int __init snd_card_cs4231_probe(int dev) int err; if (port[dev] == SNDRV_AUTO_PORT) { - snd_printk("specify port\n"); + snd_printk(KERN_ERR "specify port\n"); return -EINVAL; } if (irq[dev] == SNDRV_AUTO_IRQ) { - snd_printk("specify irq\n"); + snd_printk(KERN_ERR "specify irq\n"); return -EINVAL; } if (dma1[dev] == SNDRV_AUTO_DMA) { - snd_printk("specify dma1\n"); + snd_printk(KERN_ERR "specify dma1\n"); return -EINVAL; } card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); @@ -96,15 +96,11 @@ static int __init snd_card_cs4231_probe(int dev) dma1[dev], dma2[dev], CS4231_HW_DETECT, - 0, &chip)) < 0) { - snd_card_free(card); - return err; - } + 0, &chip)) < 0) + goto _err; - if ((err = snd_cs4231_pcm(chip, 0, &pcm)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_cs4231_pcm(chip, 0, &pcm)) < 0) + goto _err; strcpy(card->driver, "CS4231"); strcpy(card->shortname, pcm->name); @@ -113,14 +109,10 @@ static int __init snd_card_cs4231_probe(int dev) if (dma2[dev] >= 0) sprintf(card->longname + strlen(card->longname), "&%d", dma2[dev]); - if ((err = snd_cs4231_mixer(chip)) < 0) { - snd_card_free(card); - return err; - } - if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_cs4231_mixer(chip)) < 0) + goto _err; + if ((err = snd_cs4231_timer(chip, 0, NULL)) < 0) + goto _err; if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) { if (mpu_irq[dev] == SNDRV_AUTO_IRQ) @@ -130,14 +122,20 @@ static int __init snd_card_cs4231_probe(int dev) mpu_irq[dev], mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) - printk(KERN_ERR "cs4231: MPU401 not detected\n"); - } - if ((err = snd_card_register(card)) < 0) { - snd_card_free(card); - return err; + printk(KERN_WARNING "cs4231: MPU401 not detected\n"); } + + if ((err = snd_card_set_generic_dev(card)) < 0) + goto _err; + + if ((err = snd_card_register(card)) < 0) + goto _err; snd_cs4231_cards[dev] = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __init alsa_card_cs4231_init(void) |