default:
opl3->command = &snd_opl2_command;
if ((err = snd_opl3_detect(opl3)) < 0) {
- snd_opl3_free(opl3);
snd_printd("OPL2/3 chip not detected at 0x%lx/0x%lx\n",
opl3->l_port, opl3->r_port);
+ snd_opl3_free(opl3);
return err;
}
/* detect routine returns correct hardware type */
return err;
}
if (gus->max_flag || gus->ess_flag) {
- snd_card_free(card);
snd_printdd("GUS Classic or ACE soundcard was not detected at 0x%lx\n", gus->gf1.port);
+ snd_card_free(card);
return -ENODEV;
}
if ((err = snd_gf1_new_mixer(gus)) < 0) {
return err;
}
if (!gus->ess_flag) {
- snd_card_free(card);
snd_printdd("GUS Extreme soundcard was not detected at 0x%lx\n", gus->gf1.port);
+ snd_card_free(card);
return -ENODEV;
}
if ((err = snd_es1688_pcm(es1688, 0, NULL)) < 0) {
return err;
}
if (!gus->max_flag) {
- snd_card_free(card);
printk(KERN_ERR "GUS MAX soundcard was not detected at 0x%lx\n", gus->gf1.port);
+ snd_card_free(card);
return -ENODEV;
}
chip->codec_port = pci_resource_start(pci, 0);
if ((chip->res_codec_port = request_region(chip->codec_port, 0x80, "Aztech AZF3328 I/O")) == NULL) {
- snd_azf3328_free(chip);
snd_printk("unable to grab I/O port at 0x%lx-0x%lx\n", chip->codec_port, chip->codec_port + 0x80 - 1);
+ snd_azf3328_free(chip);
return -EBUSY;
}
chip->io2_port = pci_resource_start(pci, 1);
if ((chip->res_io2_port = request_region(chip->io2_port, 0x08, "Aztech AZF3328 I/O 2")) == NULL) {
- snd_azf3328_free(chip);
snd_printk("unable to grab I/O 2 port at 0x%lx-0x%lx\n", chip->io2_port, chip->io2_port + 0x08 - 1);
+ snd_azf3328_free(chip);
return -EBUSY;
}
chip->mpu_port = pci_resource_start(pci, 2);
if ((chip->res_mpu_port = request_region(chip->mpu_port, 0x04, "Aztech AZF3328 MPU401")) == NULL) {
- snd_azf3328_free(chip);
snd_printk("unable to grab MPU401 port at 0x%lx-0x%lx\n", chip->mpu_port, chip->mpu_port + 0x04 - 1);
+ snd_azf3328_free(chip);
return -EBUSY;
}
chip->synth_port = pci_resource_start(pci, 3);
if ((chip->res_synth_port = request_region(chip->synth_port, 0x08, "Aztech AZF3328 OPL3")) == NULL) {
- snd_azf3328_free(chip);
snd_printk("unable to grab OPL3 port at 0x%lx-0x%lx\n", chip->synth_port, chip->synth_port + 0x08 - 1);
+ snd_azf3328_free(chip);
return -EBUSY;
}
chip->mixer_port = pci_resource_start(pci, 4);
if ((chip->res_mixer_port = request_region(chip->mixer_port, 0x40, "Aztech AZF3328 Mixer")) == NULL) {
- snd_azf3328_free(chip);
snd_printk("unable to grab mixer port at 0x%lx-0x%lx\n", chip->mixer_port, chip->mixer_port + 0x40 - 1);
+ snd_azf3328_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_azf3328_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) {
- snd_azf3328_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_azf3328_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_MPU401,
chip->mpu_port, 1, pci->irq, 0,
&chip->rmidi)) < 0) {
- snd_card_free(card);
snd_printk("azf3328: no MPU-401 device at 0x%lx?\n", chip->mpu_port);
+ snd_card_free(card);
return err;
}
chip->dual_codec = dual_codec;
if ((chip->ba0_res = request_mem_region(chip->ba0_addr, CS4281_BA0_SIZE, "CS4281 BA0")) == NULL) {
- snd_cs4281_free(chip);
snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", chip->ba0_addr, chip->ba0_addr + CS4281_BA0_SIZE - 1);
+ snd_cs4281_free(chip);
return -ENOMEM;
}
if ((chip->ba1_res = request_mem_region(chip->ba1_addr, CS4281_BA1_SIZE, "CS4281 BA1")) == NULL) {
- snd_cs4281_free(chip);
snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", chip->ba1_addr, chip->ba1_addr + CS4281_BA1_SIZE - 1);
+ snd_cs4281_free(chip);
return -ENOMEM;
}
if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ, "CS4281", (void *)chip)) {
- snd_cs4281_free(chip);
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+ snd_cs4281_free(chip);
return -ENOMEM;
}
chip->irq = pci->irq;
chip->ba1_addr = pci_resource_start(pci, 1);
if (chip->ba0_addr == 0 || chip->ba0_addr == (unsigned long)~0 ||
chip->ba1_addr == 0 || chip->ba1_addr == (unsigned long)~0) {
- snd_cs46xx_free(chip);
snd_printk("wrong address(es) - ba0 = 0x%lx, ba1 = 0x%lx\n", chip->ba0_addr, chip->ba1_addr);
+ snd_cs46xx_free(chip);
return -ENOMEM;
}
ensoniq->irq = -1;
ensoniq->port = pci_resource_start(pci, 0);
if ((ensoniq->res_port = request_region(ensoniq->port, 0x40, "Ensoniq AudioPCI")) == NULL) {
- snd_ensoniq_free(ensoniq);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ensoniq->port, ensoniq->port + 0x40 - 1);
+ snd_ensoniq_free(ensoniq);
return -EBUSY;
}
if (request_irq(pci->irq, snd_audiopci_interrupt, SA_INTERRUPT|SA_SHIRQ, "Ensoniq AudioPCI", (void *)ensoniq)) {
- snd_ensoniq_free(ensoniq);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_ensoniq_free(ensoniq);
return -EBUSY;
}
ensoniq->irq = pci->irq;
#ifdef CHIP1370
if ((ensoniq->bugbuf = snd_malloc_pci_pages(pci, 16, &ensoniq->bugbuf_addr)) == NULL) {
- snd_ensoniq_free(ensoniq);
snd_printk("unable to allocate space for phantom area - bugbuf\n");
+ snd_ensoniq_free(ensoniq);
return -EBUSY;
}
#endif
chip->pci = pci;
chip->io_port = pci_resource_start(pci, 0);
if ((chip->res_io_port = request_region(chip->io_port, 8, "ESS Solo-1")) == NULL) {
- snd_es1938_free(chip);
snd_printk("unable to grab region 0x%lx-0x%lx\n", chip->io_port, chip->io_port + 8 - 1);
+ snd_es1938_free(chip);
return -EBUSY;
}
chip->sb_port = pci_resource_start(pci, 1);
if ((chip->res_sb_port = request_region(chip->sb_port, 0x10, "ESS Solo-1 SB")) == NULL) {
- snd_es1938_free(chip);
snd_printk("unable to grab SB region 0x%lx-0x%lx\n", chip->sb_port, chip->sb_port + 0x10 - 1);
+ snd_es1938_free(chip);
return -EBUSY;
}
chip->vc_port = pci_resource_start(pci, 2);
if ((chip->res_vc_port = request_region(chip->vc_port, 0x10, "ESS Solo-1 VC (DMA)")) == NULL) {
- snd_es1938_free(chip);
snd_printk("unable to grab VC (DMA) region 0x%lx-0x%lx\n", chip->vc_port, chip->vc_port + 0x10 - 1);
+ snd_es1938_free(chip);
return -EBUSY;
}
chip->mpu_port = pci_resource_start(pci, 3);
if ((chip->res_mpu_port = request_region(chip->mpu_port, 4, "ESS Solo-1 MIDI")) == NULL) {
- snd_es1938_free(chip);
snd_printk("unable to grab MIDI region 0x%lx-0x%lx\n", chip->mpu_port, chip->mpu_port + 4 - 1);
+ snd_es1938_free(chip);
return -EBUSY;
}
chip->game_port = pci_resource_start(pci, 4);
if ((chip->res_game_port = request_region(chip->game_port, 4, "ESS Solo-1 GAME")) == NULL) {
- snd_es1938_free(chip);
snd_printk("unable to grab GAME region 0x%lx-0x%lx\n", chip->game_port, chip->game_port + 4 - 1);
+ snd_es1938_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_es1938_interrupt, SA_INTERRUPT|SA_SHIRQ, "ES1938", (void *)chip)) {
- snd_es1938_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_es1938_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
chip->io_port = pci_resource_start(pci, 0);
if ((chip->res_io_port = request_region(chip->io_port, 0x100, "ESS Maestro")) == NULL) {
- snd_es1968_free(chip);
snd_printk("unable to grab region 0x%lx-0x%lx\n", chip->io_port, chip->io_port + 0x100 - 1);
+ snd_es1968_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_es1968_interrupt, SA_INTERRUPT|SA_SHIRQ,
"ESS Maestro", (void*)chip)) {
- snd_es1968_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_es1968_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
synchronize_irq(pci->irq);
if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
- snd_ice1712_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->port, ice->port + 32 - 1);
+ snd_ice1712_free(ice);
return -EIO;
}
if ((ice->res_ddma_port = request_region(ice->ddma_port, 16, "ICE1712 - DDMA")) == NULL) {
- snd_ice1712_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->ddma_port, ice->ddma_port + 16 - 1);
+ snd_ice1712_free(ice);
return -EIO;
}
if ((ice->res_dmapath_port = request_region(ice->dmapath_port, 16, "ICE1712 - DMA path")) == NULL) {
- snd_ice1712_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->dmapath_port, ice->dmapath_port + 16 - 1);
+ snd_ice1712_free(ice);
return -EIO;
}
if ((ice->res_profi_port = request_region(ice->profi_port, 64, "ICE1712 - Professional")) == NULL) {
- snd_ice1712_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->profi_port, ice->profi_port + 16 - 1);
+ snd_ice1712_free(ice);
return -EIO;
}
if (request_irq(pci->irq, snd_ice1712_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1712", (void *) ice)) {
- snd_ice1712_free(ice);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_ice1712_free(ice);
return -EIO;
}
synchronize_irq(pci->irq);
if ((ice->res_port = request_region(ice->port, 32, "ICE1724 - Controller")) == NULL) {
- snd_vt1724_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->port, ice->port + 32 - 1);
+ snd_vt1724_free(ice);
return -EIO;
}
if ((ice->res_profi_port = request_region(ice->profi_port, 128, "ICE1724 - Professional")) == NULL) {
- snd_vt1724_free(ice);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", ice->profi_port, ice->profi_port + 16 - 1);
+ snd_vt1724_free(ice);
return -EIO;
}
if (request_irq(pci->irq, snd_vt1724_interrupt, SA_INTERRUPT|SA_SHIRQ, "ICE1724", (void *) ice)) {
- snd_vt1724_free(ice);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_vt1724_free(ice);
return -EIO;
}
sonic->irq = -1;
sonic->sb_port = pci_resource_start(pci, 0);
if ((sonic->res_sb_port = request_region(sonic->sb_port, 0x10, "S3 SonicVibes SB")) == NULL) {
- snd_sonicvibes_free(sonic);
snd_printk("unable to grab SB port at 0x%lx-0x%lx\n", sonic->sb_port, sonic->sb_port + 0x10 - 1);
+ snd_sonicvibes_free(sonic);
return -EBUSY;
}
sonic->enh_port = pci_resource_start(pci, 1);
if ((sonic->res_enh_port = request_region(sonic->enh_port, 0x10, "S3 SonicVibes Enhanced")) == NULL) {
- snd_sonicvibes_free(sonic);
snd_printk("unable to grab PCM port at 0x%lx-0x%lx\n", sonic->enh_port, sonic->enh_port + 0x10 - 1);
+ snd_sonicvibes_free(sonic);
return -EBUSY;
}
sonic->synth_port = pci_resource_start(pci, 2);
if ((sonic->res_synth_port = request_region(sonic->synth_port, 4, "S3 SonicVibes Synth")) == NULL) {
- snd_sonicvibes_free(sonic);
snd_printk("unable to grab synth port at 0x%lx-0x%lx\n", sonic->synth_port, sonic->synth_port + 4 - 1);
+ snd_sonicvibes_free(sonic);
return -EBUSY;
}
sonic->midi_port = pci_resource_start(pci, 3);
if ((sonic->res_midi_port = request_region(sonic->midi_port, 4, "S3 SonicVibes Midi")) == NULL) {
- snd_sonicvibes_free(sonic);
snd_printk("unable to grab MIDI port at 0x%lx-0x%lx\n", sonic->midi_port, sonic->midi_port + 4 - 1);
+ snd_sonicvibes_free(sonic);
return -EBUSY;
}
sonic->game_port = pci_resource_start(pci, 4);
if (request_irq(pci->irq, snd_sonicvibes_interrupt, SA_INTERRUPT|SA_SHIRQ, "S3 SonicVibes", (void *)sonic)) {
- snd_magic_kfree(sonic);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_sonicvibes_free(sonic);
return -EBUSY;
}
sonic->irq = pci->irq;
trident->port = pci_resource_start(pci, 0);
if ((trident->res_port = request_region(trident->port, 0x100, "Trident Audio")) == NULL) {
- snd_trident_free(trident);
snd_printk("unable to grab I/O region 0x%lx-0x%lx\n", trident->port, trident->port + 0x100 - 1);
+ snd_trident_free(trident);
return -EBUSY;
}
if (request_irq(pci->irq, snd_trident_interrupt, SA_INTERRUPT|SA_SHIRQ, "Trident Audio", (void *) trident)) {
- snd_trident_free(trident);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_trident_free(trident);
return -EBUSY;
}
trident->irq = pci->irq;
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 256, card->driver)) == NULL) {
- snd_via82xx_free(chip);
snd_printk("unable to grab ports 0x%lx-0x%lx\n", chip->port, chip->port + 256 - 1);
+ snd_via82xx_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_via82xx_interrupt, SA_INTERRUPT|SA_SHIRQ,
card->driver, (void *)chip)) {
- snd_via82xx_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_via82xx_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
pci_set_master(pci);
if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) {
- snd_ymfpci_free(chip);
snd_printk("unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + 0x8000 - 1);
+ snd_ymfpci_free(chip);
return -EBUSY;
}
if (request_irq(pci->irq, snd_ymfpci_interrupt, SA_INTERRUPT|SA_SHIRQ, "YMFPCI", (void *) chip)) {
- snd_ymfpci_free(chip);
snd_printk("unable to grab IRQ %d\n", pci->irq);
+ snd_ymfpci_free(chip);
return -EBUSY;
}
chip->irq = pci->irq;
if (request_irq(irq_prop->pri, snd_amd7930_interrupt,
SA_INTERRUPT | SA_SHIRQ, "amd7930", amd)) {
- snd_amd7930_free(amd);
snd_printk("amd7930-%d: Unable to grab IRQ %s\n",
dev,
__irq_itoa(irq_prop->pri));
+ snd_amd7930_free(amd);
return -EBUSY;
}
amd->irq = irq_prop->pri;
if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt,
SA_SHIRQ, "cs4231", chip)) {
- snd_cs4231_sbus_free(chip);
snd_printk("cs4231-%d: Unable to grab SBUS IRQ %s\n",
dev,
__irq_itoa(sdev->irqs[0]));
+ snd_cs4231_sbus_free(chip);
return -EBUSY;
}
chip->irq[0] = sdev->irqs[0];