diff options
author | Rene Herman <rene.herman@gmail.com> | 2007-11-30 11:59:25 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:30 -0500 |
commit | 109c53f840e551d6e99ecfd8b0131a968332c89f (patch) | |
tree | 212af8d6ebb3303a21dd44b032fd5949fdc37607 /sound/isa/opti9xx | |
parent | df1deb67532ea26f1a033a5f48bf34b30bec8e1d (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/opti9xx')
-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 */ |