aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
diff options
context:
space:
mode:
authorRene Herman <rene.herman@gmail.com>2007-11-30 11:59:25 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:30 -0500
commit109c53f840e551d6e99ecfd8b0131a968332c89f (patch)
tree212af8d6ebb3303a21dd44b032fd5949fdc37607 /sound/isa/gus
parentdf1deb67532ea26f1a033a5f48bf34b30bec8e1d (diff)
[ALSA] sound/isa: kill pnp_resource_change
This removes the pnp_resource_change use from the ALSA ISAPnP drivers. In 2.4 these were useful in providing an easy path to setting the resources, but in 2.6 they retain function as a layering violation only. This makes for a nice cleanup (-550 lines) of ALSA but moreover, ALSA is the only remaining user of pnp_init_resource_table(), pnp_resource_change() and pnp_manual_config_dev() (and, in fact, of 'struct pnp_resource_table') in the tree outide of drivers/pnp itself meaning it makes for more cleanup potential inside the PnP layer. Thomas Renninger acked their removal from that side, you did from the ALSA side (CC list just copied from that thread). Against current alsa-kernel HG. Many more potential cleanups in there, but this _only_ removes the pnp_resource_change code. Compile tested against current alsa-kernel HG and compile- and use-tested against 2.6.23.x (few offsets). Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Rene Herman <rene.herman@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/isa/gus')
-rw-r--r--sound/isa/gus/interwave.c39
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 */