diff options
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index ee1a824d8fc0..9300cf371ee8 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -1690,53 +1690,19 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
1690 | const struct pnp_card_device_id *pid) | 1690 | const struct pnp_card_device_id *pid) |
1691 | { | 1691 | { |
1692 | struct pnp_dev *pdev; | 1692 | struct pnp_dev *pdev; |
1693 | struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); | ||
1694 | int err; | 1693 | int err; |
1695 | 1694 | ||
1696 | if (!cfg) | ||
1697 | return -ENOMEM; | ||
1698 | chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); | 1695 | chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); |
1699 | if (chip->dev == NULL) { | 1696 | if (chip->dev == NULL) |
1700 | kfree(cfg); | ||
1701 | return -EBUSY; | 1697 | return -EBUSY; |
1702 | } | 1698 | |
1703 | chip->devmpu = pnp_request_card_device(card, pid->devs[1].id, NULL); | 1699 | chip->devmpu = pnp_request_card_device(card, pid->devs[1].id, NULL); |
1704 | 1700 | ||
1705 | pdev = chip->dev; | 1701 | pdev = chip->dev; |
1706 | pnp_init_resource_table(cfg); | ||
1707 | 1702 | ||
1708 | #ifdef OPTi93X | ||
1709 | if (port != SNDRV_AUTO_PORT) | ||
1710 | pnp_resource_change(&cfg->port_resource[0], port + 4, 4); | ||
1711 | #else | ||
1712 | if (pid->driver_data != 0x0924 && port != SNDRV_AUTO_PORT) | ||
1713 | pnp_resource_change(&cfg->port_resource[1], port, 4); | ||
1714 | #endif /* OPTi93X */ | ||
1715 | if (irq != SNDRV_AUTO_IRQ) | ||
1716 | pnp_resource_change(&cfg->irq_resource[0], irq, 1); | ||
1717 | if (dma1 != SNDRV_AUTO_DMA) | ||
1718 | pnp_resource_change(&cfg->dma_resource[0], dma1, 1); | ||
1719 | #if defined(CS4231) || defined(OPTi93X) | ||
1720 | if (dma2 != SNDRV_AUTO_DMA) | ||
1721 | pnp_resource_change(&cfg->dma_resource[1], dma2, 1); | ||
1722 | #else | ||
1723 | #ifdef snd_opti9xx_fixup_dma2 | ||
1724 | snd_opti9xx_fixup_dma2(pdev); | ||
1725 | #endif | ||
1726 | #endif /* CS4231 || OPTi93X */ | ||
1727 | #ifdef OPTi93X | ||
1728 | if (fm_port > 0 && fm_port != SNDRV_AUTO_PORT) | ||
1729 | pnp_resource_change(&cfg->port_resource[1], fm_port, 4); | ||
1730 | #else | ||
1731 | if (fm_port > 0 && fm_port != SNDRV_AUTO_PORT) | ||
1732 | pnp_resource_change(&cfg->port_resource[2], fm_port, 4); | ||
1733 | #endif | ||
1734 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
1735 | snd_printk(KERN_ERR "AUDIO the requested resources are invalid, using auto config\n"); | ||
1736 | err = pnp_activate_dev(pdev); | 1703 | err = pnp_activate_dev(pdev); |
1737 | if (err < 0) { | 1704 | if (err < 0) { |
1738 | snd_printk(KERN_ERR "AUDIO pnp configure failure: %d\n", err); | 1705 | snd_printk(KERN_ERR "AUDIO pnp configure failure: %d\n", err); |
1739 | kfree(cfg); | ||
1740 | return err; | 1706 | return err; |
1741 | } | 1707 | } |
1742 | 1708 | ||
@@ -1756,15 +1722,6 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
1756 | 1722 | ||
1757 | pdev = chip->devmpu; | 1723 | pdev = chip->devmpu; |
1758 | if (pdev && mpu_port > 0) { | 1724 | if (pdev && mpu_port > 0) { |
1759 | pnp_init_resource_table(cfg); | ||
1760 | |||
1761 | if (mpu_port != SNDRV_AUTO_PORT) | ||
1762 | pnp_resource_change(&cfg->port_resource[0], mpu_port, 2); | ||
1763 | if (mpu_irq != SNDRV_AUTO_IRQ) | ||
1764 | pnp_resource_change(&cfg->irq_resource[0], mpu_irq, 1); | ||
1765 | |||
1766 | if (pnp_manual_config_dev(pdev, cfg, 0) < 0) | ||
1767 | snd_printk(KERN_ERR "AUDIO the requested resources are invalid, using auto config\n"); | ||
1768 | err = pnp_activate_dev(pdev); | 1725 | err = pnp_activate_dev(pdev); |
1769 | if (err < 0) { | 1726 | if (err < 0) { |
1770 | snd_printk(KERN_ERR "AUDIO pnp configure failure\n"); | 1727 | snd_printk(KERN_ERR "AUDIO pnp configure failure\n"); |
@@ -1775,7 +1732,6 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
1775 | mpu_irq = pnp_irq(pdev, 0); | 1732 | mpu_irq = pnp_irq(pdev, 0); |
1776 | } | 1733 | } |
1777 | } | 1734 | } |
1778 | kfree(cfg); | ||
1779 | return pid->driver_data; | 1735 | return pid->driver_data; |
1780 | } | 1736 | } |
1781 | #endif /* CONFIG_PNP */ | 1737 | #endif /* CONFIG_PNP */ |