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/es18xx.c | |
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/es18xx.c')
-rw-r--r-- | sound/isa/es18xx.c | 56 |
1 files changed, 9 insertions, 47 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index c1af28fd4a1f..5d4f1635ffdd 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2035,31 +2035,9 @@ static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { | |||
2035 | MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids); | 2035 | MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids); |
2036 | 2036 | ||
2037 | /* PnP main device initialization */ | 2037 | /* PnP main device initialization */ |
2038 | static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev, | 2038 | static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev) |
2039 | struct pnp_resource_table *cfg) | ||
2040 | { | 2039 | { |
2041 | int err; | 2040 | if (pnp_activate_dev(pdev) < 0) { |
2042 | |||
2043 | pnp_init_resource_table(cfg); | ||
2044 | if (port[dev] != SNDRV_AUTO_PORT) | ||
2045 | pnp_resource_change(&cfg->port_resource[0], port[dev], 16); | ||
2046 | if (fm_port[dev] != SNDRV_AUTO_PORT) | ||
2047 | pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4); | ||
2048 | if (mpu_port[dev] != SNDRV_AUTO_PORT) | ||
2049 | pnp_resource_change(&cfg->port_resource[2], mpu_port[dev], 2); | ||
2050 | if (dma1[dev] != SNDRV_AUTO_DMA) | ||
2051 | pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1); | ||
2052 | if (dma2[dev] != SNDRV_AUTO_DMA) | ||
2053 | pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1); | ||
2054 | if (irq[dev] != SNDRV_AUTO_IRQ) | ||
2055 | pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); | ||
2056 | if (pnp_device_is_isapnp(pdev)) { | ||
2057 | err = pnp_manual_config_dev(pdev, cfg, 0); | ||
2058 | if (err < 0) | ||
2059 | snd_printk(KERN_ERR PFX "PnP manual resources are invalid, using auto config\n"); | ||
2060 | } | ||
2061 | err = pnp_activate_dev(pdev); | ||
2062 | if (err < 0) { | ||
2063 | snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n"); | 2041 | snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n"); |
2064 | return -EBUSY; | 2042 | return -EBUSY; |
2065 | } | 2043 | } |
@@ -2087,16 +2065,9 @@ static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev, | |||
2087 | static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard, | 2065 | static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard, |
2088 | struct pnp_dev *pdev) | 2066 | struct pnp_dev *pdev) |
2089 | { | 2067 | { |
2090 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | ||
2091 | |||
2092 | if (!cfg) | ||
2093 | return -ENOMEM; | ||
2094 | acard->dev = pdev; | 2068 | acard->dev = pdev; |
2095 | if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) { | 2069 | if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0) |
2096 | kfree(cfg); | ||
2097 | return -EBUSY; | 2070 | return -EBUSY; |
2098 | } | ||
2099 | kfree(cfg); | ||
2100 | return 0; | 2071 | return 0; |
2101 | } | 2072 | } |
2102 | 2073 | ||
@@ -2125,33 +2096,24 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, | |||
2125 | struct pnp_card_link *card, | 2096 | struct pnp_card_link *card, |
2126 | const struct pnp_card_device_id *id) | 2097 | const struct pnp_card_device_id *id) |
2127 | { | 2098 | { |
2128 | struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | ||
2129 | |||
2130 | if (!cfg) | ||
2131 | return -ENOMEM; | ||
2132 | acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); | 2099 | acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); |
2133 | if (acard->dev == NULL) { | 2100 | if (acard->dev == NULL) |
2134 | kfree(cfg); | ||
2135 | return -EBUSY; | 2101 | return -EBUSY; |
2136 | } | 2102 | |
2137 | acard->devc = pnp_request_card_device(card, id->devs[1].id, NULL); | 2103 | acard->devc = pnp_request_card_device(card, id->devs[1].id, NULL); |
2138 | if (acard->devc == NULL) { | 2104 | if (acard->devc == NULL) |
2139 | kfree(cfg); | ||
2140 | return -EBUSY; | 2105 | return -EBUSY; |
2141 | } | 2106 | |
2142 | /* Control port initialization */ | 2107 | /* Control port initialization */ |
2143 | if (pnp_activate_dev(acard->devc) < 0) { | 2108 | if (pnp_activate_dev(acard->devc) < 0) { |
2144 | kfree(cfg); | ||
2145 | snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); | 2109 | snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); |
2146 | return -EAGAIN; | 2110 | return -EAGAIN; |
2147 | } | 2111 | } |
2148 | snd_printdd("pnp: port=0x%llx\n", | 2112 | snd_printdd("pnp: port=0x%llx\n", |
2149 | (unsigned long long)pnp_port_start(acard->devc, 0)); | 2113 | (unsigned long long)pnp_port_start(acard->devc, 0)); |
2150 | if (snd_audiodrive_pnp_init_main(dev, acard->dev, cfg) < 0) { | 2114 | if (snd_audiodrive_pnp_init_main(dev, acard->dev) < 0) |
2151 | kfree(cfg); | ||
2152 | return -EBUSY; | 2115 | return -EBUSY; |
2153 | } | 2116 | |
2154 | kfree(cfg); | ||
2155 | return 0; | 2117 | return 0; |
2156 | } | 2118 | } |
2157 | #endif /* CONFIG_PNP */ | 2119 | #endif /* CONFIG_PNP */ |