aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/dt019x.c
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/dt019x.c
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/dt019x.c')
-rw-r--r--sound/isa/dt019x.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c
index ce57d526f7bc..ab689f948aea 100644
--- a/sound/isa/dt019x.c
+++ b/sound/isa/dt019x.c
@@ -56,18 +56,6 @@ module_param_array(id, charp, NULL, 0444);
56MODULE_PARM_DESC(id, "ID string for DT-019X based soundcard."); 56MODULE_PARM_DESC(id, "ID string for DT-019X based soundcard.");
57module_param_array(enable, bool, NULL, 0444); 57module_param_array(enable, bool, NULL, 0444);
58MODULE_PARM_DESC(enable, "Enable DT-019X based soundcard."); 58MODULE_PARM_DESC(enable, "Enable DT-019X based soundcard.");
59module_param_array(port, long, NULL, 0444);
60MODULE_PARM_DESC(port, "Port # for dt019x driver.");
61module_param_array(mpu_port, long, NULL, 0444);
62MODULE_PARM_DESC(mpu_port, "MPU-401 port # for dt019x driver.");
63module_param_array(fm_port, long, NULL, 0444);
64MODULE_PARM_DESC(fm_port, "FM port # for dt019x driver.");
65module_param_array(irq, int, NULL, 0444);
66MODULE_PARM_DESC(irq, "IRQ # for dt019x driver.");
67module_param_array(mpu_irq, int, NULL, 0444);
68MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for dt019x driver.");
69module_param_array(dma8, int, NULL, 0444);
70MODULE_PARM_DESC(dma8, "8-bit DMA # for dt019x driver.");
71 59
72struct snd_card_dt019x { 60struct snd_card_dt019x {
73 struct pnp_dev *dev; 61 struct pnp_dev *dev;
@@ -95,36 +83,20 @@ static int __devinit snd_card_dt019x_pnp(int dev, struct snd_card_dt019x *acard,
95 const struct pnp_card_device_id *pid) 83 const struct pnp_card_device_id *pid)
96{ 84{
97 struct pnp_dev *pdev; 85 struct pnp_dev *pdev;
98 struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
99 int err; 86 int err;
100 87
101 if (!cfg)
102 return -ENOMEM;
103
104 acard->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); 88 acard->dev = pnp_request_card_device(card, pid->devs[0].id, NULL);
105 if (acard->dev == NULL) { 89 if (acard->dev == NULL)
106 kfree (cfg);
107 return -ENODEV; 90 return -ENODEV;
108 } 91
109 acard->devmpu = pnp_request_card_device(card, pid->devs[1].id, NULL); 92 acard->devmpu = pnp_request_card_device(card, pid->devs[1].id, NULL);
110 acard->devopl = pnp_request_card_device(card, pid->devs[2].id, NULL); 93 acard->devopl = pnp_request_card_device(card, pid->devs[2].id, NULL);
111 94
112 pdev = acard->dev; 95 pdev = acard->dev;
113 pnp_init_resource_table(cfg);
114
115 if (port[dev] != SNDRV_AUTO_PORT)
116 pnp_resource_change(&cfg->port_resource[0], port[dev], 16);
117 if (dma8[dev] != SNDRV_AUTO_DMA)
118 pnp_resource_change(&cfg->dma_resource[0], dma8[dev], 1);
119 if (irq[dev] != SNDRV_AUTO_IRQ)
120 pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
121 96
122 if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
123 snd_printk(KERN_ERR PFX "DT-019X AUDIO the requested resources are invalid, using auto config\n");
124 err = pnp_activate_dev(pdev); 97 err = pnp_activate_dev(pdev);
125 if (err < 0) { 98 if (err < 0) {
126 snd_printk(KERN_ERR PFX "DT-019X AUDIO pnp configure failure\n"); 99 snd_printk(KERN_ERR PFX "DT-019X AUDIO pnp configure failure\n");
127 kfree(cfg);
128 return err; 100 return err;
129 } 101 }
130 102
@@ -135,15 +107,7 @@ static int __devinit snd_card_dt019x_pnp(int dev, struct snd_card_dt019x *acard,
135 port[dev],irq[dev],dma8[dev]); 107 port[dev],irq[dev],dma8[dev]);
136 108
137 pdev = acard->devmpu; 109 pdev = acard->devmpu;
138
139 if (pdev != NULL) { 110 if (pdev != NULL) {
140 pnp_init_resource_table(cfg);
141 if (mpu_port[dev] != SNDRV_AUTO_PORT)
142 pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
143 if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
144 pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
145 if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
146 snd_printk(KERN_ERR PFX "DT-019X MPU401 the requested resources are invalid, using auto config\n");
147 err = pnp_activate_dev(pdev); 111 err = pnp_activate_dev(pdev);
148 if (err < 0) { 112 if (err < 0) {
149 pnp_release_card_device(pdev); 113 pnp_release_card_device(pdev);
@@ -162,11 +126,6 @@ static int __devinit snd_card_dt019x_pnp(int dev, struct snd_card_dt019x *acard,
162 126
163 pdev = acard->devopl; 127 pdev = acard->devopl;
164 if (pdev != NULL) { 128 if (pdev != NULL) {
165 pnp_init_resource_table(cfg);
166 if (fm_port[dev] != SNDRV_AUTO_PORT)
167 pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4);
168 if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
169 snd_printk(KERN_ERR PFX "DT-019X OPL3 the requested resources are invalid, using auto config\n");
170 err = pnp_activate_dev(pdev); 129 err = pnp_activate_dev(pdev);
171 if (err < 0) { 130 if (err < 0) {
172 pnp_release_card_device(pdev); 131 pnp_release_card_device(pdev);
@@ -181,7 +140,6 @@ static int __devinit snd_card_dt019x_pnp(int dev, struct snd_card_dt019x *acard,
181 fm_port[dev] = -1; 140 fm_port[dev] = -1;
182 } 141 }
183 142
184 kfree(cfg);
185 return 0; 143 return 0;
186} 144}
187 145