diff options
Diffstat (limited to 'sound/isa/gus/interwave.c')
-rw-r--r-- | sound/isa/gus/interwave.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 2091c50b2e3e..9381d1e8ad75 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -560,50 +560,27 @@ static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard, | |||
560 | const struct pnp_card_device_id *id) | 560 | const struct pnp_card_device_id *id) |
561 | { | 561 | { |
562 | struct pnp_dev *pdev; | 562 | struct pnp_dev *pdev; |
563 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | ||
564 | int err; | 563 | int err; |
565 | 564 | ||
566 | if (!cfg) | ||
567 | return -ENOMEM; | ||
568 | iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); | 565 | iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); |
569 | if (iwcard->dev == NULL) { | 566 | if (iwcard->dev == NULL) |
570 | kfree(cfg); | ||
571 | return -EBUSY; | 567 | return -EBUSY; |
572 | } | 568 | |
573 | #ifdef SNDRV_STB | 569 | #ifdef SNDRV_STB |
574 | iwcard->devtc = pnp_request_card_device(card, id->devs[1].id, NULL); | 570 | iwcard->devtc = pnp_request_card_device(card, id->devs[1].id, NULL); |
575 | if (iwcard->devtc == NULL) { | 571 | if (iwcard->devtc == NULL) |
576 | kfree(cfg); | ||
577 | return -EBUSY; | 572 | return -EBUSY; |
578 | } | ||
579 | #endif | 573 | #endif |
580 | /* Synth & Codec initialization */ | 574 | /* Synth & Codec initialization */ |
581 | pdev = iwcard->dev; | 575 | pdev = iwcard->dev; |
582 | pnp_init_resource_table(cfg); | 576 | |
583 | if (port[dev] != SNDRV_AUTO_PORT) { | ||
584 | pnp_resource_change(&cfg->port_resource[0], port[dev], 16); | ||
585 | pnp_resource_change(&cfg->port_resource[1], port[dev] + 0x100, 12); | ||
586 | pnp_resource_change(&cfg->port_resource[2], port[dev] + 0x10c, 4); | ||
587 | } | ||
588 | if (dma1[dev] != SNDRV_AUTO_DMA) | ||
589 | pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1); | ||
590 | if (dma2[dev] != SNDRV_AUTO_DMA) | ||
591 | pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1); | ||
592 | if (dma2[dev] < 0) | ||
593 | pnp_resource_change(&cfg->dma_resource[1], 4, 1); | ||
594 | if (irq[dev] != SNDRV_AUTO_IRQ) | ||
595 | pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); | ||
596 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
597 | snd_printk(KERN_ERR "InterWave - Synth - the requested resources are invalid, using auto config\n"); | ||
598 | err = pnp_activate_dev(pdev); | 577 | err = pnp_activate_dev(pdev); |
599 | if (err < 0) { | 578 | if (err < 0) { |
600 | kfree(cfg); | ||
601 | snd_printk(KERN_ERR "InterWave PnP configure failure (out of resources?)\n"); | 579 | snd_printk(KERN_ERR "InterWave PnP configure failure (out of resources?)\n"); |
602 | return err; | 580 | return err; |
603 | } | 581 | } |
604 | if (pnp_port_start(pdev, 0) + 0x100 != pnp_port_start(pdev, 1) || | 582 | if (pnp_port_start(pdev, 0) + 0x100 != pnp_port_start(pdev, 1) || |
605 | pnp_port_start(pdev, 0) + 0x10c != pnp_port_start(pdev, 2)) { | 583 | pnp_port_start(pdev, 0) + 0x10c != pnp_port_start(pdev, 2)) { |
606 | kfree(cfg); | ||
607 | snd_printk(KERN_ERR "PnP configure failure (wrong ports)\n"); | 584 | snd_printk(KERN_ERR "PnP configure failure (wrong ports)\n"); |
608 | return -ENOENT; | 585 | return -ENOENT; |
609 | } | 586 | } |
@@ -620,21 +597,15 @@ static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard, | |||
620 | #ifdef SNDRV_STB | 597 | #ifdef SNDRV_STB |
621 | /* Tone Control initialization */ | 598 | /* Tone Control initialization */ |
622 | pdev = iwcard->devtc; | 599 | pdev = iwcard->devtc; |
623 | pnp_init_resource_table(cfg); | 600 | |
624 | if (port_tc[dev] != SNDRV_AUTO_PORT) | ||
625 | pnp_resource_change(&cfg->port_resource[0], port_tc[dev], 1); | ||
626 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
627 | snd_printk(KERN_ERR "InterWave - ToneControl - the requested resources are invalid, using auto config\n"); | ||
628 | err = pnp_activate_dev(pdev); | 601 | err = pnp_activate_dev(pdev); |
629 | if (err < 0) { | 602 | if (err < 0) { |
630 | kfree(cfg); | ||
631 | snd_printk(KERN_ERR "InterWave ToneControl PnP configure failure (out of resources?)\n"); | 603 | snd_printk(KERN_ERR "InterWave ToneControl PnP configure failure (out of resources?)\n"); |
632 | return err; | 604 | return err; |
633 | } | 605 | } |
634 | port_tc[dev] = pnp_port_start(pdev, 0); | 606 | port_tc[dev] = pnp_port_start(pdev, 0); |
635 | snd_printdd("isapnp IW: tone control port=0x%lx\n", port_tc[dev]); | 607 | snd_printdd("isapnp IW: tone control port=0x%lx\n", port_tc[dev]); |
636 | #endif | 608 | #endif |
637 | kfree(cfg); | ||
638 | return 0; | 609 | return 0; |
639 | } | 610 | } |
640 | #endif /* CONFIG_PNP */ | 611 | #endif /* CONFIG_PNP */ |