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/sgalaxy.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/sgalaxy.c')
-rw-r--r-- | sound/isa/sgalaxy.c | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index 17f585b..52f2294d 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c @@ -67,6 +67,8 @@ MODULE_PARM_DESC(dma1, "DMA1 # for Sound Galaxy driver."); static snd_card_t *snd_sgalaxy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; +#define PFX "sgalaxy: " + /* */ @@ -135,7 +137,7 @@ static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma) } #if 0 - snd_printdd("sgalaxy - setting up IRQ/DMA for WSS\n"); + snd_printdd(PFX "setting up IRQ/DMA for WSS\n"); #endif /* initialize IRQ for WSS codec */ @@ -160,7 +162,7 @@ static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma) static int __init snd_sgalaxy_detect(int dev, int irq, int dma) { #if 0 - snd_printdd("sgalaxy - switching to WSS mode\n"); + snd_printdd(PFX "switching to WSS mode\n"); #endif /* switch to WSS mode */ @@ -223,11 +225,11 @@ static int __init snd_sgalaxy_probe(int dev) ad1848_t *chip; if (sbport[dev] == SNDRV_AUTO_PORT) { - snd_printk("specify SB port\n"); + snd_printk(KERN_ERR PFX "specify SB port\n"); return -EINVAL; } if (wssport[dev] == SNDRV_AUTO_PORT) { - snd_printk("specify WSS port\n"); + snd_printk(KERN_ERR PFX "specify WSS port\n"); return -EINVAL; } card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); @@ -237,46 +239,39 @@ static int __init snd_sgalaxy_probe(int dev) xirq = irq[dev]; if (xirq == SNDRV_AUTO_IRQ) { if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) { - snd_card_free(card); - snd_printk("unable to find a free IRQ\n"); - return -EBUSY; + snd_printk(KERN_ERR PFX "unable to find a free IRQ\n"); + err = -EBUSY; + goto _err; } } xdma1 = dma1[dev]; if (xdma1 == SNDRV_AUTO_DMA) { if ((xdma1 = snd_legacy_find_free_dma(possible_dmas)) < 0) { - snd_card_free(card); - snd_printk("unable to find a free DMA\n"); - return -EBUSY; + snd_printk(KERN_ERR PFX "unable to find a free DMA\n"); + err = -EBUSY; + goto _err; } } - if ((err = snd_sgalaxy_detect(dev, xirq, xdma1)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_sgalaxy_detect(dev, xirq, xdma1)) < 0) + goto _err; if ((err = snd_ad1848_create(card, wssport[dev] + 4, xirq, xdma1, - AD1848_HW_DETECT, &chip)) < 0) { - snd_card_free(card); - return err; - } + AD1848_HW_DETECT, &chip)) < 0) + goto _err; if ((err = snd_ad1848_pcm(chip, 0, NULL)) < 0) { - snd_printdd("sgalaxy - error creating new ad1848 PCM device\n"); - snd_card_free(card); - return err; + snd_printdd(PFX "error creating new ad1848 PCM device\n"); + goto _err; } if ((err = snd_ad1848_mixer(chip)) < 0) { - snd_printdd("sgalaxy - error creating new ad1848 mixer\n"); - snd_card_free(card); - return err; + snd_printdd(PFX "error creating new ad1848 mixer\n"); + goto _err; } - if (snd_sgalaxy_mixer(chip) < 0) { - snd_printdd("sgalaxy - the mixer rewrite failed\n"); - snd_card_free(card); - return err; + if ((err = snd_sgalaxy_mixer(chip)) < 0) { + snd_printdd(PFX "the mixer rewrite failed\n"); + goto _err; } strcpy(card->driver, "Sound Galaxy"); @@ -284,12 +279,18 @@ static int __init snd_sgalaxy_probe(int dev) sprintf(card->longname, "Sound Galaxy at 0x%lx, irq %d, dma %d", wssport[dev], xirq, xdma1); - if ((err = snd_card_register(card)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_card_set_generic_dev(card)) < 0) + goto _err; + + if ((err = snd_card_register(card)) < 0) + goto _err; + snd_sgalaxy_cards[dev] = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __init alsa_card_sgalaxy_init(void) |