aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/ad1816a
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/ad1816a
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/ad1816a')
-rw-r--r--sound/isa/ad1816a/ad1816a.c53
1 files changed, 5 insertions, 48 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index fc88a31da6f5..994bc85376c1 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -61,20 +61,6 @@ module_param_array(id, charp, NULL, 0444);
61MODULE_PARM_DESC(id, "ID string for ad1816a based soundcard."); 61MODULE_PARM_DESC(id, "ID string for ad1816a based soundcard.");
62module_param_array(enable, bool, NULL, 0444); 62module_param_array(enable, bool, NULL, 0444);
63MODULE_PARM_DESC(enable, "Enable ad1816a based soundcard."); 63MODULE_PARM_DESC(enable, "Enable ad1816a based soundcard.");
64module_param_array(port, long, NULL, 0444);
65MODULE_PARM_DESC(port, "Port # for ad1816a driver.");
66module_param_array(mpu_port, long, NULL, 0444);
67MODULE_PARM_DESC(mpu_port, "MPU-401 port # for ad1816a driver.");
68module_param_array(fm_port, long, NULL, 0444);
69MODULE_PARM_DESC(fm_port, "FM port # for ad1816a driver.");
70module_param_array(irq, int, NULL, 0444);
71MODULE_PARM_DESC(irq, "IRQ # for ad1816a driver.");
72module_param_array(mpu_irq, int, NULL, 0444);
73MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ad1816a driver.");
74module_param_array(dma1, int, NULL, 0444);
75MODULE_PARM_DESC(dma1, "1st DMA # for ad1816a driver.");
76module_param_array(dma2, int, NULL, 0444);
77MODULE_PARM_DESC(dma2, "2nd DMA # for ad1816a driver.");
78module_param_array(clockfreq, int, NULL, 0444); 64module_param_array(clockfreq, int, NULL, 0444);
79MODULE_PARM_DESC(clockfreq, "Clock frequency for ad1816a driver (default = 0)."); 65MODULE_PARM_DESC(clockfreq, "Clock frequency for ad1816a driver (default = 0).");
80 66
@@ -117,16 +103,12 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
117 const struct pnp_card_device_id *id) 103 const struct pnp_card_device_id *id)
118{ 104{
119 struct pnp_dev *pdev; 105 struct pnp_dev *pdev;
120 struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
121 int err; 106 int err;
122 107
123 if (!cfg)
124 return -ENOMEM;
125 acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); 108 acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
126 if (acard->dev == NULL) { 109 if (acard->dev == NULL)
127 kfree(cfg);
128 return -EBUSY; 110 return -EBUSY;
129 } 111
130 acard->devmpu = pnp_request_card_device(card, id->devs[1].id, NULL); 112 acard->devmpu = pnp_request_card_device(card, id->devs[1].id, NULL);
131 if (acard->devmpu == NULL) { 113 if (acard->devmpu == NULL) {
132 mpu_port[dev] = -1; 114 mpu_port[dev] = -1;
@@ -134,25 +116,10 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
134 } 116 }
135 117
136 pdev = acard->dev; 118 pdev = acard->dev;
137 pnp_init_resource_table(cfg); 119
138
139 if (port[dev] != SNDRV_AUTO_PORT)
140 pnp_resource_change(&cfg->port_resource[2], port[dev], 16);
141 if (fm_port[dev] != SNDRV_AUTO_PORT)
142 pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
143 if (dma1[dev] != SNDRV_AUTO_DMA)
144 pnp_resource_change(&cfg->dma_resource[0], dma1[dev], 1);
145 if (dma2[dev] != SNDRV_AUTO_DMA)
146 pnp_resource_change(&cfg->dma_resource[1], dma2[dev], 1);
147 if (irq[dev] != SNDRV_AUTO_IRQ)
148 pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
149
150 if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
151 snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
152 err = pnp_activate_dev(pdev); 120 err = pnp_activate_dev(pdev);
153 if (err < 0) { 121 if (err < 0) {
154 printk(KERN_ERR PFX "AUDIO PnP configure failure\n"); 122 printk(KERN_ERR PFX "AUDIO PnP configure failure\n");
155 kfree(cfg);
156 return -EBUSY; 123 return -EBUSY;
157 } 124 }
158 125
@@ -162,20 +129,11 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
162 dma2[dev] = pnp_dma(pdev, 1); 129 dma2[dev] = pnp_dma(pdev, 1);
163 irq[dev] = pnp_irq(pdev, 0); 130 irq[dev] = pnp_irq(pdev, 0);
164 131
165 if (acard->devmpu == NULL) { 132 if (acard->devmpu == NULL)
166 kfree(cfg);
167 return 0; 133 return 0;
168 }
169 pdev = acard->devmpu;
170 pnp_init_resource_table(cfg);
171 134
172 if (mpu_port[dev] != SNDRV_AUTO_PORT) 135 pdev = acard->devmpu;
173 pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
174 if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
175 pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
176 136
177 if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
178 snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
179 err = pnp_activate_dev(pdev); 137 err = pnp_activate_dev(pdev);
180 if (err < 0) { 138 if (err < 0) {
181 printk(KERN_ERR PFX "MPU401 PnP configure failure\n"); 139 printk(KERN_ERR PFX "MPU401 PnP configure failure\n");
@@ -186,7 +144,6 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
186 mpu_irq[dev] = pnp_irq(pdev, 0); 144 mpu_irq[dev] = pnp_irq(pdev, 0);
187 } 145 }
188 146
189 kfree(cfg);
190 return 0; 147 return 0;
191} 148}
192 149