aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/es18xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/es18xx.c')
-rw-r--r--sound/isa/es18xx.c56
1 files changed, 9 insertions, 47 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index c1af28fd4a1..5d4f1635ffd 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2035,31 +2035,9 @@ static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids);
/* PnP main device initialization */
-static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev,
- struct pnp_resource_table *cfg)
+static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev)
{
- int err;
-
- pnp_init_resource_table(cfg);
- if (port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[0], port[dev], 16);
- if (fm_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
- if (mpu_port[dev] != SNDRV_AUTO_PORT)
- pnp_resource_change(&cfg->port_resource[2], mpu_port[dev], 2);
- if (dma1[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1);
- if (dma2[dev] != SNDRV_AUTO_DMA)
- pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1);
- if (irq[dev] != SNDRV_AUTO_IRQ)
- pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
- if (pnp_device_is_isapnp(pdev)) {
- err = pnp_manual_config_dev(pdev, cfg, 0);
- if (err < 0)
- snd_printk(KERN_ERR PFX "PnP manual resources are invalid, using auto config\n");
- }
- err = pnp_activate_dev(pdev);
- if (err < 0) {
+ if (pnp_activate_dev(pdev) < 0) {
snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n");
return -EBUSY;
}
@@ -2087,16 +2065,9 @@ static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev,
static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard,
struct pnp_dev *pdev)
{
- struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
-
- if (!cfg)
- return -ENOMEM;
acard->dev = pdev;
- if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) {
- kfree(cfg);
+ if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0)
return -EBUSY;
- }
- kfree(cfg);
return 0;
}
@@ -2125,33 +2096,24 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard,
struct pnp_card_link *card,
const struct pnp_card_device_id *id)
{
- struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
-
- if (!cfg)
- return -ENOMEM;
acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
- if (acard->dev == NULL) {
- kfree(cfg);
+ if (acard->dev == NULL)
return -EBUSY;
- }
+
acard->devc = pnp_request_card_device(card, id->devs[1].id, NULL);
- if (acard->devc == NULL) {
- kfree(cfg);
+ if (acard->devc == NULL)
return -EBUSY;
- }
+
/* Control port initialization */
if (pnp_activate_dev(acard->devc) < 0) {
- kfree(cfg);
snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n");
return -EAGAIN;
}
snd_printdd("pnp: port=0x%llx\n",
(unsigned long long)pnp_port_start(acard->devc, 0));
- if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) {
- kfree(cfg);
+ if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0)
return -EBUSY;
- }
- kfree(cfg);
+
return 0;
}
#endif /* CONFIG_PNP */