From 43bcd973d6d05d16b876e09dcc49a09d3e48e88d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 5 Sep 2005 17:19:20 +0200 Subject: [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 --- sound/isa/ad1848/ad1848.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'sound/isa/ad1848/ad1848.c') diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 8c399340cd7..3ebcc482b07 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c @@ -91,35 +91,36 @@ static int __init snd_card_ad1848_probe(int dev) irq[dev], dma1[dev], thinkpad[dev] ? AD1848_HW_THINKPAD : AD1848_HW_DETECT, - &chip)) < 0) { - snd_card_free(card); - return err; - } + &chip)) < 0) + goto _err; + + if ((err = snd_ad1848_pcm(chip, 0, &pcm)) < 0) + goto _err; + + if ((err = snd_ad1848_mixer(chip)) < 0) + goto _err; - if ((err = snd_ad1848_pcm(chip, 0, &pcm)) < 0) { - snd_card_free(card); - return err; - } - if ((err = snd_ad1848_mixer(chip)) < 0) { - snd_card_free(card); - return err; - } strcpy(card->driver, "AD1848"); strcpy(card->shortname, pcm->name); sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", pcm->name, chip->port, irq[dev], dma1[dev]); - if (thinkpad[dev]) { + if (thinkpad[dev]) strcat(card->longname, " [Thinkpad]"); - } - 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_ad1848_cards[dev] = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __init alsa_card_ad1848_init(void) -- cgit v1.2.3-70-g09d2