aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 11:09:02 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 11:09:02 -0500
commit8f0cb147b2fb12427bf6abef7fed2b604557a41e (patch)
treefb5ba437ee74b900fab9686c8c7df18abcd7640b /sound/isa
parent8e33ba49765484bc6de3a2f8143733713fa93bc1 (diff)
parentb00e8443c3eece823052d06ae1c7cb797ab0ddf5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c5
-rw-r--r--sound/isa/ad1848/ad1848_lib.c27
-rw-r--r--sound/isa/cs423x/cs4231_lib.c10
-rw-r--r--sound/isa/cs423x/cs4236.c8
-rw-r--r--sound/isa/cs423x/cs4236_lib.c5
-rw-r--r--sound/isa/es1688/es1688_lib.c3
-rw-r--r--sound/isa/es18xx.c49
-rw-r--r--sound/isa/gus/gus_dma.c2
-rw-r--r--sound/isa/gus/gus_io.c94
-rw-r--r--sound/isa/gus/gus_main.c25
-rw-r--r--sound/isa/gus/gus_mem.c2
-rw-r--r--sound/isa/gus/gus_pcm.c5
-rw-r--r--sound/isa/gus/gus_reset.c4
-rw-r--r--sound/isa/gus/gus_simple.c2
-rw-r--r--sound/isa/gus/gus_uart.c4
-rw-r--r--sound/isa/gus/gus_volume.c6
-rw-r--r--sound/isa/gus/interwave.c9
-rw-r--r--sound/isa/opl3sa2.c5
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c25
-rw-r--r--sound/isa/sb/emu8000.c24
-rw-r--r--sound/isa/sb/emu8000_patch.c3
-rw-r--r--sound/isa/sb/emu8000_pcm.c3
-rw-r--r--sound/isa/sb/emu8000_synth.c2
-rw-r--r--sound/isa/sb/sb16.c5
-rw-r--r--sound/isa/sb/sb16_main.c8
-rw-r--r--sound/isa/sb/sb8.c5
-rw-r--r--sound/isa/sb/sb8_main.c3
-rw-r--r--sound/isa/sb/sb_common.c12
-rw-r--r--sound/isa/sb/sb_mixer.c4
-rw-r--r--sound/isa/sscape.c23
-rw-r--r--sound/isa/wavefront/wavefront.c5
-rw-r--r--sound/isa/wavefront/wavefront_synth.c6
32 files changed, 150 insertions, 243 deletions
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 27a9dcfbba00..7ae02396cae2 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -542,10 +542,7 @@ static int snd_ad1816a_probe(ad1816a_t *chip)
542 542
543static int snd_ad1816a_free(ad1816a_t *chip) 543static int snd_ad1816a_free(ad1816a_t *chip)
544{ 544{
545 if (chip->res_port) { 545 release_and_free_resource(chip->res_port);
546 release_resource(chip->res_port);
547 kfree_nocheck(chip->res_port);
548 }
549 if (chip->irq >= 0) 546 if (chip->irq >= 0)
550 free_irq(chip->irq, (void *) chip); 547 free_irq(chip->irq, (void *) chip);
551 if (chip->dma1 >= 0) { 548 if (chip->dma1 >= 0) {
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 303861cd03cd..891bacc94f68 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -109,7 +109,7 @@ void snd_ad1848_out(ad1848_t *chip,
109 udelay(100); 109 udelay(100);
110#ifdef CONFIG_SND_DEBUG 110#ifdef CONFIG_SND_DEBUG
111 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 111 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
112 snd_printk("auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 112 snd_printk(KERN_WARNING "auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value);
113#endif 113#endif
114 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL)); 114 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL));
115 outb(chip->image[reg] = value, AD1848P(chip, REG)); 115 outb(chip->image[reg] = value, AD1848P(chip, REG));
@@ -139,7 +139,7 @@ static unsigned char snd_ad1848_in(ad1848_t *chip, unsigned char reg)
139 udelay(100); 139 udelay(100);
140#ifdef CONFIG_SND_DEBUG 140#ifdef CONFIG_SND_DEBUG
141 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 141 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
142 snd_printk("auto calibration time out - reg = 0x%x\n", reg); 142 snd_printk(KERN_WARNING "auto calibration time out - reg = 0x%x\n", reg);
143#endif 143#endif
144 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL)); 144 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL));
145 mb(); 145 mb();
@@ -185,13 +185,13 @@ static void snd_ad1848_mce_up(ad1848_t *chip)
185 udelay(100); 185 udelay(100);
186#ifdef CONFIG_SND_DEBUG 186#ifdef CONFIG_SND_DEBUG
187 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 187 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
188 snd_printk("mce_up - auto calibration time out (0)\n"); 188 snd_printk(KERN_WARNING "mce_up - auto calibration time out (0)\n");
189#endif 189#endif
190 spin_lock_irqsave(&chip->reg_lock, flags); 190 spin_lock_irqsave(&chip->reg_lock, flags);
191 chip->mce_bit |= AD1848_MCE; 191 chip->mce_bit |= AD1848_MCE;
192 timeout = inb(AD1848P(chip, REGSEL)); 192 timeout = inb(AD1848P(chip, REGSEL));
193 if (timeout == 0x80) 193 if (timeout == 0x80)
194 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 194 snd_printk(KERN_WARNING "mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port);
195 if (!(timeout & AD1848_MCE)) 195 if (!(timeout & AD1848_MCE))
196 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL)); 196 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL));
197 spin_unlock_irqrestore(&chip->reg_lock, flags); 197 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -214,13 +214,13 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
214#endif 214#endif
215#ifdef CONFIG_SND_DEBUG 215#ifdef CONFIG_SND_DEBUG
216 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 216 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
217 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", AD1848P(chip, REGSEL)); 217 snd_printk(KERN_WARNING "mce_down [0x%lx] - auto calibration time out (0)\n", AD1848P(chip, REGSEL));
218#endif 218#endif
219 chip->mce_bit &= ~AD1848_MCE; 219 chip->mce_bit &= ~AD1848_MCE;
220 timeout = inb(AD1848P(chip, REGSEL)); 220 timeout = inb(AD1848P(chip, REGSEL));
221 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL)); 221 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL));
222 if (timeout == 0x80) 222 if (timeout == 0x80)
223 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); 223 snd_printk(KERN_WARNING "mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port);
224 if ((timeout & AD1848_MCE) == 0) { 224 if ((timeout & AD1848_MCE) == 0) {
225 spin_unlock_irqrestore(&chip->reg_lock, flags); 225 spin_unlock_irqrestore(&chip->reg_lock, flags);
226 return; 226 return;
@@ -240,11 +240,10 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
240 while (snd_ad1848_in(chip, AD1848_TEST_INIT) & AD1848_CALIB_IN_PROGRESS) { 240 while (snd_ad1848_in(chip, AD1848_TEST_INIT) & AD1848_CALIB_IN_PROGRESS) {
241 spin_unlock_irqrestore(&chip->reg_lock, flags); 241 spin_unlock_irqrestore(&chip->reg_lock, flags);
242 if (time <= 0) { 242 if (time <= 0) {
243 snd_printk("mce_down - auto calibration time out (2)\n"); 243 snd_printk(KERN_ERR "mce_down - auto calibration time out (2)\n");
244 return; 244 return;
245 } 245 }
246 set_current_state(TASK_INTERRUPTIBLE); 246 time = schedule_timeout_interruptible(time);
247 time = schedule_timeout(time);
248 spin_lock_irqsave(&chip->reg_lock, flags); 247 spin_lock_irqsave(&chip->reg_lock, flags);
249 } 248 }
250#if 0 249#if 0
@@ -254,11 +253,10 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
254 while (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) { 253 while (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) {
255 spin_unlock_irqrestore(&chip->reg_lock, flags); 254 spin_unlock_irqrestore(&chip->reg_lock, flags);
256 if (time <= 0) { 255 if (time <= 0) {
257 snd_printk("mce_down - auto calibration time out (3)\n"); 256 snd_printk(KERN_ERR "mce_down - auto calibration time out (3)\n");
258 return; 257 return;
259 } 258 }
260 set_current_state(TASK_INTERRUPTIBLE); 259 time = schedule_timeout_interruptible(time);
261 time = schedule_timeout(time);
262 spin_lock_irqsave(&chip->reg_lock, flags); 260 spin_lock_irqsave(&chip->reg_lock, flags);
263 } 261 }
264 spin_unlock_irqrestore(&chip->reg_lock, flags); 262 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -846,10 +844,7 @@ static int snd_ad1848_capture_close(snd_pcm_substream_t * substream)
846 844
847static int snd_ad1848_free(ad1848_t *chip) 845static int snd_ad1848_free(ad1848_t *chip)
848{ 846{
849 if (chip->res_port) { 847 release_and_free_resource(chip->res_port);
850 release_resource(chip->res_port);
851 kfree_nocheck(chip->res_port);
852 }
853 if (chip->irq >= 0) 848 if (chip->irq >= 0)
854 free_irq(chip->irq, (void *) chip); 849 free_irq(chip->irq, (void *) chip);
855 if (chip->dma >= 0) { 850 if (chip->dma >= 0) {
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index 32318258cd8e..4af769030beb 100644
--- a/sound/isa/cs423x/cs4231_lib.c
+++ b/sound/isa/cs423x/cs4231_lib.c
@@ -1417,14 +1417,8 @@ static int snd_cs4231_pm_resume(snd_card_t *card)
1417 1417
1418static int snd_cs4231_free(cs4231_t *chip) 1418static int snd_cs4231_free(cs4231_t *chip)
1419{ 1419{
1420 if (chip->res_port) { 1420 release_and_free_resource(chip->res_port);
1421 release_resource(chip->res_port); 1421 release_and_free_resource(chip->res_cport);
1422 kfree_nocheck(chip->res_port);
1423 }
1424 if (chip->res_cport) {
1425 release_resource(chip->res_cport);
1426 kfree_nocheck(chip->res_cport);
1427 }
1428 if (chip->irq >= 0) { 1422 if (chip->irq >= 0) {
1429 disable_irq(chip->irq); 1423 disable_irq(chip->irq);
1430 if (!(chip->hwshare & CS4231_HWSHARE_IRQ)) 1424 if (!(chip->hwshare & CS4231_HWSHARE_IRQ))
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index d28315dc72f7..d60a55e6a0b1 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -379,12 +379,8 @@ static void snd_card_cs4236_free(snd_card_t *card)
379{ 379{
380 struct snd_card_cs4236 *acard = (struct snd_card_cs4236 *)card->private_data; 380 struct snd_card_cs4236 *acard = (struct snd_card_cs4236 *)card->private_data;
381 381
382 if (acard) { 382 if (acard)
383 if (acard->res_sb_port) { 383 release_and_free_resource(acard->res_sb_port);
384 release_resource(acard->res_sb_port);
385 kfree_nocheck(acard->res_sb_port);
386 }
387 }
388} 384}
389 385
390#ifdef CONFIG_PNP 386#ifdef CONFIG_PNP
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 2128d4bdef41..1adb88d5f8f4 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -173,7 +173,10 @@ static unsigned char divisor_to_rate_register(unsigned int divisor)
173 case 2117: return 6; 173 case 2117: return 6;
174 case 2558: return 7; 174 case 2558: return 7;
175 default: 175 default:
176 snd_runtime_check(divisor >= 21 && divisor <= 192, return 192); 176 if (divisor < 21 || divisor > 192) {
177 snd_BUG();
178 return 192;
179 }
177 return divisor; 180 return divisor;
178 } 181 }
179} 182}
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index aac898765c02..2edc9c9f0445 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -606,8 +606,7 @@ static int snd_es1688_free(es1688_t *chip)
606{ 606{
607 if (chip->res_port) { 607 if (chip->res_port) {
608 snd_es1688_init(chip, 0); 608 snd_es1688_init(chip, 0);
609 release_resource(chip->res_port); 609 release_and_free_resource(chip->res_port);
610 kfree_nocheck(chip->res_port);
611 } 610 }
612 if (chip->irq >= 0) 611 if (chip->irq >= 0)
613 free_irq(chip->irq, (void *) chip); 612 free_irq(chip->irq, (void *) chip);
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index d0ea19f42703..970e2aaade27 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -173,7 +173,7 @@ static int snd_es18xx_dsp_command(es18xx_t *chip, unsigned char val)
173 outb(val, chip->port + 0x0C); 173 outb(val, chip->port + 0x0C);
174 return 0; 174 return 0;
175 } 175 }
176 snd_printk("dsp_command: timeout (0x%x)\n", val); 176 snd_printk(KERN_ERR "dsp_command: timeout (0x%x)\n", val);
177 return -EINVAL; 177 return -EINVAL;
178} 178}
179 179
@@ -184,7 +184,8 @@ static int snd_es18xx_dsp_get_byte(es18xx_t *chip)
184 for(i = MILLISECOND/10; i; i--) 184 for(i = MILLISECOND/10; i; i--)
185 if (inb(chip->port + 0x0C) & 0x40) 185 if (inb(chip->port + 0x0C) & 0x40)
186 return inb(chip->port + 0x0A); 186 return inb(chip->port + 0x0A);
187 snd_printk("dsp_get_byte failed: 0x%lx = 0x%x!!!\n", chip->port + 0x0A, inb(chip->port + 0x0A)); 187 snd_printk(KERN_ERR "dsp_get_byte failed: 0x%lx = 0x%x!!!\n",
188 chip->port + 0x0A, inb(chip->port + 0x0A));
188 return -ENODEV; 189 return -ENODEV;
189} 190}
190 191
@@ -204,7 +205,7 @@ static int snd_es18xx_write(es18xx_t *chip,
204 end: 205 end:
205 spin_unlock_irqrestore(&chip->reg_lock, flags); 206 spin_unlock_irqrestore(&chip->reg_lock, flags);
206#ifdef REG_DEBUG 207#ifdef REG_DEBUG
207 snd_printk("Reg %02x set to %02x\n", reg, data); 208 snd_printk(KERN_DEBUG "Reg %02x set to %02x\n", reg, data);
208#endif 209#endif
209 return ret; 210 return ret;
210} 211}
@@ -223,7 +224,7 @@ static int snd_es18xx_read(es18xx_t *chip, unsigned char reg)
223 data = snd_es18xx_dsp_get_byte(chip); 224 data = snd_es18xx_dsp_get_byte(chip);
224 ret = data; 225 ret = data;
225#ifdef REG_DEBUG 226#ifdef REG_DEBUG
226 snd_printk("Reg %02x now is %02x (%d)\n", reg, data, ret); 227 snd_printk(KERN_DEBUG "Reg %02x now is %02x (%d)\n", reg, data, ret);
227#endif 228#endif
228 end: 229 end:
229 spin_unlock_irqrestore(&chip->reg_lock, flags); 230 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -259,7 +260,8 @@ static int snd_es18xx_bits(es18xx_t *chip, unsigned char reg,
259 if (ret < 0) 260 if (ret < 0)
260 goto end; 261 goto end;
261#ifdef REG_DEBUG 262#ifdef REG_DEBUG
262 snd_printk("Reg %02x was %02x, set to %02x (%d)\n", reg, old, new, ret); 263 snd_printk(KERN_DEBUG "Reg %02x was %02x, set to %02x (%d)\n",
264 reg, old, new, ret);
263#endif 265#endif
264 } 266 }
265 ret = oval; 267 ret = oval;
@@ -277,7 +279,7 @@ static inline void snd_es18xx_mixer_write(es18xx_t *chip,
277 outb(data, chip->port + 0x05); 279 outb(data, chip->port + 0x05);
278 spin_unlock_irqrestore(&chip->mixer_lock, flags); 280 spin_unlock_irqrestore(&chip->mixer_lock, flags);
279#ifdef REG_DEBUG 281#ifdef REG_DEBUG
280 snd_printk("Mixer reg %02x set to %02x\n", reg, data); 282 snd_printk(KERN_DEBUG "Mixer reg %02x set to %02x\n", reg, data);
281#endif 283#endif
282} 284}
283 285
@@ -290,7 +292,7 @@ static inline int snd_es18xx_mixer_read(es18xx_t *chip, unsigned char reg)
290 data = inb(chip->port + 0x05); 292 data = inb(chip->port + 0x05);
291 spin_unlock_irqrestore(&chip->mixer_lock, flags); 293 spin_unlock_irqrestore(&chip->mixer_lock, flags);
292#ifdef REG_DEBUG 294#ifdef REG_DEBUG
293 snd_printk("Mixer reg %02x now is %02x\n", reg, data); 295 snd_printk(KERN_DEBUG "Mixer reg %02x now is %02x\n", reg, data);
294#endif 296#endif
295 return data; 297 return data;
296} 298}
@@ -309,7 +311,8 @@ static inline int snd_es18xx_mixer_bits(es18xx_t *chip, unsigned char reg,
309 new = (old & ~mask) | (val & mask); 311 new = (old & ~mask) | (val & mask);
310 outb(new, chip->port + 0x05); 312 outb(new, chip->port + 0x05);
311#ifdef REG_DEBUG 313#ifdef REG_DEBUG
312 snd_printk("Mixer reg %02x was %02x, set to %02x\n", reg, old, new); 314 snd_printk(KERN_DEBUG "Mixer reg %02x was %02x, set to %02x\n",
315 reg, old, new);
313#endif 316#endif
314 } 317 }
315 spin_unlock_irqrestore(&chip->mixer_lock, flags); 318 spin_unlock_irqrestore(&chip->mixer_lock, flags);
@@ -329,7 +332,8 @@ static inline int snd_es18xx_mixer_writable(es18xx_t *chip, unsigned char reg,
329 new = inb(chip->port + 0x05); 332 new = inb(chip->port + 0x05);
330 spin_unlock_irqrestore(&chip->mixer_lock, flags); 333 spin_unlock_irqrestore(&chip->mixer_lock, flags);
331#ifdef REG_DEBUG 334#ifdef REG_DEBUG
332 snd_printk("Mixer reg %02x was %02x, set to %02x, now is %02x\n", reg, old, expected, new); 335 snd_printk(KERN_DEBUG "Mixer reg %02x was %02x, set to %02x, now is %02x\n",
336 reg, old, expected, new);
333#endif 337#endif
334 return expected == new; 338 return expected == new;
335} 339}
@@ -1281,7 +1285,7 @@ static void __devinit snd_es18xx_config_write(es18xx_t *chip,
1281 outb(reg, chip->ctrl_port); 1285 outb(reg, chip->ctrl_port);
1282 outb(data, chip->ctrl_port + 1); 1286 outb(data, chip->ctrl_port + 1);
1283#ifdef REG_DEBUG 1287#ifdef REG_DEBUG
1284 snd_printk("Config reg %02x set to %02x\n", reg, data); 1288 snd_printk(KERN_DEBUG "Config reg %02x set to %02x\n", reg, data);
1285#endif 1289#endif
1286} 1290}
1287 1291
@@ -1346,7 +1350,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1346 irqmask = 3; 1350 irqmask = 3;
1347 break; 1351 break;
1348 default: 1352 default:
1349 snd_printk("invalid irq %d\n", chip->irq); 1353 snd_printk(KERN_ERR "invalid irq %d\n", chip->irq);
1350 return -ENODEV; 1354 return -ENODEV;
1351 } 1355 }
1352 switch (chip->dma1) { 1356 switch (chip->dma1) {
@@ -1360,7 +1364,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1360 dma1mask = 3; 1364 dma1mask = 3;
1361 break; 1365 break;
1362 default: 1366 default:
1363 snd_printk("invalid dma1 %d\n", chip->dma1); 1367 snd_printk(KERN_ERR "invalid dma1 %d\n", chip->dma1);
1364 return -ENODEV; 1368 return -ENODEV;
1365 } 1369 }
1366 switch (chip->dma2) { 1370 switch (chip->dma2) {
@@ -1377,7 +1381,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1377 dma2mask = 3; 1381 dma2mask = 3;
1378 break; 1382 break;
1379 default: 1383 default:
1380 snd_printk("invalid dma2 %d\n", chip->dma2); 1384 snd_printk(KERN_ERR "invalid dma2 %d\n", chip->dma2);
1381 return -ENODEV; 1385 return -ENODEV;
1382 } 1386 }
1383 1387
@@ -1440,7 +1444,7 @@ static int __devinit snd_es18xx_identify(es18xx_t *chip)
1440 1444
1441 /* reset */ 1445 /* reset */
1442 if (snd_es18xx_reset(chip) < 0) { 1446 if (snd_es18xx_reset(chip) < 0) {
1443 snd_printk("reset at 0x%lx failed!!!\n", chip->port); 1447 snd_printk(KERN_ERR "reset at 0x%lx failed!!!\n", chip->port);
1444 return -ENODEV; 1448 return -ENODEV;
1445 } 1449 }
1446 1450
@@ -1527,7 +1531,7 @@ static int __devinit snd_es18xx_probe(es18xx_t *chip)
1527 chip->caps = ES18XX_PCM2 | ES18XX_RECMIX | ES18XX_AUXB | ES18XX_DUPLEX_SAME | ES18XX_HWV; 1531 chip->caps = ES18XX_PCM2 | ES18XX_RECMIX | ES18XX_AUXB | ES18XX_DUPLEX_SAME | ES18XX_HWV;
1528 break; 1532 break;
1529 default: 1533 default:
1530 snd_printk("[0x%lx] unsupported chip ES%x\n", 1534 snd_printk(KERN_ERR "[0x%lx] unsupported chip ES%x\n",
1531 chip->port, chip->version); 1535 chip->port, chip->version);
1532 return -ENODEV; 1536 return -ENODEV;
1533 } 1537 }
@@ -1640,18 +1644,9 @@ static int snd_es18xx_resume(snd_card_t *card)
1640 1644
1641static int snd_es18xx_free(es18xx_t *chip) 1645static int snd_es18xx_free(es18xx_t *chip)
1642{ 1646{
1643 if (chip->res_port) { 1647 release_and_free_resource(chip->res_port);
1644 release_resource(chip->res_port); 1648 release_and_free_resource(chip->res_ctrl_port);
1645 kfree_nocheck(chip->res_port); 1649 release_and_free_resource(chip->res_mpu_port);
1646 }
1647 if (chip->res_ctrl_port) {
1648 release_resource(chip->res_ctrl_port);
1649 kfree_nocheck(chip->res_ctrl_port);
1650 }
1651 if (chip->res_mpu_port) {
1652 release_resource(chip->res_mpu_port);
1653 kfree_nocheck(chip->res_mpu_port);
1654 }
1655 if (chip->irq >= 0) 1650 if (chip->irq >= 0)
1656 free_irq(chip->irq, (void *) chip); 1651 free_irq(chip->irq, (void *) chip);
1657 if (chip->dma1 >= 0) { 1652 if (chip->dma1 >= 0) {
diff --git a/sound/isa/gus/gus_dma.c b/sound/isa/gus/gus_dma.c
index de4b56d80b35..ef1b2e9832e4 100644
--- a/sound/isa/gus/gus_dma.c
+++ b/sound/isa/gus/gus_dma.c
@@ -199,7 +199,7 @@ int snd_gf1_dma_transfer_block(snd_gus_card_t * gus,
199 199
200 block = kmalloc(sizeof(*block), atomic ? GFP_ATOMIC : GFP_KERNEL); 200 block = kmalloc(sizeof(*block), atomic ? GFP_ATOMIC : GFP_KERNEL);
201 if (block == NULL) { 201 if (block == NULL) {
202 snd_printk("gf1: DMA transfer failure; not enough memory\n"); 202 snd_printk(KERN_ERR "gf1: DMA transfer failure; not enough memory\n");
203 return -ENOMEM; 203 return -ENOMEM;
204 } 204 }
205 *block = *__block; 205 *block = *__block;
diff --git a/sound/isa/gus/gus_io.c b/sound/isa/gus/gus_io.c
index 23e1b5f19e1a..8d5752b23787 100644
--- a/sound/isa/gus/gus_io.c
+++ b/sound/isa/gus/gus_io.c
@@ -343,7 +343,7 @@ void snd_gf1_pokew(snd_gus_card_t * gus, unsigned int addr, unsigned short data)
343 343
344#ifdef CONFIG_SND_DEBUG 344#ifdef CONFIG_SND_DEBUG
345 if (!gus->interwave) 345 if (!gus->interwave)
346 snd_printk("snd_gf1_pokew - GF1!!!\n"); 346 snd_printk(KERN_DEBUG "snd_gf1_pokew - GF1!!!\n");
347#endif 347#endif
348 spin_lock_irqsave(&gus->reg_lock, flags); 348 spin_lock_irqsave(&gus->reg_lock, flags);
349 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel); 349 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel);
@@ -367,7 +367,7 @@ unsigned short snd_gf1_peekw(snd_gus_card_t * gus, unsigned int addr)
367 367
368#ifdef CONFIG_SND_DEBUG 368#ifdef CONFIG_SND_DEBUG
369 if (!gus->interwave) 369 if (!gus->interwave)
370 snd_printk("snd_gf1_peekw - GF1!!!\n"); 370 snd_printk(KERN_DEBUG "snd_gf1_peekw - GF1!!!\n");
371#endif 371#endif
372 spin_lock_irqsave(&gus->reg_lock, flags); 372 spin_lock_irqsave(&gus->reg_lock, flags);
373 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel); 373 outb(SNDRV_GF1_GW_DRAM_IO_LOW, gus->gf1.reg_regsel);
@@ -393,7 +393,7 @@ void snd_gf1_dram_setmem(snd_gus_card_t * gus, unsigned int addr,
393 393
394#ifdef CONFIG_SND_DEBUG 394#ifdef CONFIG_SND_DEBUG
395 if (!gus->interwave) 395 if (!gus->interwave)
396 snd_printk("snd_gf1_dram_setmem - GF1!!!\n"); 396 snd_printk(KERN_DEBUG "snd_gf1_dram_setmem - GF1!!!\n");
397#endif 397#endif
398 addr &= ~1; 398 addr &= ~1;
399 count >>= 1; 399 count >>= 1;
@@ -449,30 +449,30 @@ void snd_gf1_print_voice_registers(snd_gus_card_t * gus)
449 int voice, ctrl; 449 int voice, ctrl;
450 450
451 voice = gus->gf1.active_voice; 451 voice = gus->gf1.active_voice;
452 printk(" -%i- GF1 voice ctrl, ramp ctrl = 0x%x, 0x%x\n", voice, ctrl = snd_gf1_i_read8(gus, 0), snd_gf1_i_read8(gus, 0x0d)); 452 printk(KERN_INFO " -%i- GF1 voice ctrl, ramp ctrl = 0x%x, 0x%x\n", voice, ctrl = snd_gf1_i_read8(gus, 0), snd_gf1_i_read8(gus, 0x0d));
453 printk(" -%i- GF1 frequency = 0x%x\n", voice, snd_gf1_i_read16(gus, 1)); 453 printk(KERN_INFO " -%i- GF1 frequency = 0x%x\n", voice, snd_gf1_i_read16(gus, 1));
454 printk(" -%i- GF1 loop start, end = 0x%x (0x%x), 0x%x (0x%x)\n", voice, snd_gf1_i_read_addr(gus, 2, ctrl & 4), snd_gf1_i_read_addr(gus, 2, (ctrl & 4) ^ 4), snd_gf1_i_read_addr(gus, 4, ctrl & 4), snd_gf1_i_read_addr(gus, 4, (ctrl & 4) ^ 4)); 454 printk(KERN_INFO " -%i- GF1 loop start, end = 0x%x (0x%x), 0x%x (0x%x)\n", voice, snd_gf1_i_read_addr(gus, 2, ctrl & 4), snd_gf1_i_read_addr(gus, 2, (ctrl & 4) ^ 4), snd_gf1_i_read_addr(gus, 4, ctrl & 4), snd_gf1_i_read_addr(gus, 4, (ctrl & 4) ^ 4));
455 printk(" -%i- GF1 ramp start, end, rate = 0x%x, 0x%x, 0x%x\n", voice, snd_gf1_i_read8(gus, 7), snd_gf1_i_read8(gus, 8), snd_gf1_i_read8(gus, 6)); 455 printk(KERN_INFO " -%i- GF1 ramp start, end, rate = 0x%x, 0x%x, 0x%x\n", voice, snd_gf1_i_read8(gus, 7), snd_gf1_i_read8(gus, 8), snd_gf1_i_read8(gus, 6));
456 printk(" -%i- GF1 volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 9)); 456 printk(KERN_INFO" -%i- GF1 volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 9));
457 printk(" -%i- GF1 position = 0x%x (0x%x)\n", voice, snd_gf1_i_read_addr(gus, 0x0a, ctrl & 4), snd_gf1_i_read_addr(gus, 0x0a, (ctrl & 4) ^ 4)); 457 printk(KERN_INFO " -%i- GF1 position = 0x%x (0x%x)\n", voice, snd_gf1_i_read_addr(gus, 0x0a, ctrl & 4), snd_gf1_i_read_addr(gus, 0x0a, (ctrl & 4) ^ 4));
458 if (gus->interwave && snd_gf1_i_read8(gus, 0x19) & 0x01) { /* enhanced mode */ 458 if (gus->interwave && snd_gf1_i_read8(gus, 0x19) & 0x01) { /* enhanced mode */
459 mode = snd_gf1_i_read8(gus, 0x15); 459 mode = snd_gf1_i_read8(gus, 0x15);
460 printk(" -%i- GFA1 mode = 0x%x\n", voice, mode); 460 printk(KERN_INFO " -%i- GFA1 mode = 0x%x\n", voice, mode);
461 if (mode & 0x01) { /* Effect processor */ 461 if (mode & 0x01) { /* Effect processor */
462 printk(" -%i- GFA1 effect address = 0x%x\n", voice, snd_gf1_i_read_addr(gus, 0x11, ctrl & 4)); 462 printk(KERN_INFO " -%i- GFA1 effect address = 0x%x\n", voice, snd_gf1_i_read_addr(gus, 0x11, ctrl & 4));
463 printk(" -%i- GFA1 effect volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x16)); 463 printk(KERN_INFO " -%i- GFA1 effect volume = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x16));
464 printk(" -%i- GFA1 effect volume final = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x1d)); 464 printk(KERN_INFO " -%i- GFA1 effect volume final = 0x%x\n", voice, snd_gf1_i_read16(gus, 0x1d));
465 printk(" -%i- GFA1 effect acumulator = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x14)); 465 printk(KERN_INFO " -%i- GFA1 effect acumulator = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x14));
466 } 466 }
467 if (mode & 0x20) { 467 if (mode & 0x20) {
468 printk(" -%i- GFA1 left offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x13), snd_gf1_i_read16(gus, 0x13) >> 4); 468 printk(KERN_INFO " -%i- GFA1 left offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x13), snd_gf1_i_read16(gus, 0x13) >> 4);
469 printk(" -%i- GFA1 left offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1c), snd_gf1_i_read16(gus, 0x1c) >> 4); 469 printk(KERN_INFO " -%i- GFA1 left offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1c), snd_gf1_i_read16(gus, 0x1c) >> 4);
470 printk(" -%i- GFA1 right offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x0c), snd_gf1_i_read16(gus, 0x0c) >> 4); 470 printk(KERN_INFO " -%i- GFA1 right offset = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x0c), snd_gf1_i_read16(gus, 0x0c) >> 4);
471 printk(" -%i- GFA1 right offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1b), snd_gf1_i_read16(gus, 0x1b) >> 4); 471 printk(KERN_INFO " -%i- GFA1 right offset final = 0x%x (%i)\n", voice, snd_gf1_i_read16(gus, 0x1b), snd_gf1_i_read16(gus, 0x1b) >> 4);
472 } else 472 } else
473 printk(" -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c)); 473 printk(KERN_INFO " -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c));
474 } else 474 } else
475 printk(" -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c)); 475 printk(KERN_INFO " -%i- GF1 pan = 0x%x\n", voice, snd_gf1_i_read8(gus, 0x0c));
476} 476}
477 477
478#if 0 478#if 0
@@ -481,45 +481,45 @@ void snd_gf1_print_global_registers(snd_gus_card_t * gus)
481{ 481{
482 unsigned char global_mode = 0x00; 482 unsigned char global_mode = 0x00;
483 483
484 printk(" -G- GF1 active voices = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_ACTIVE_VOICES)); 484 printk(KERN_INFO " -G- GF1 active voices = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_ACTIVE_VOICES));
485 if (gus->interwave) { 485 if (gus->interwave) {
486 global_mode = snd_gf1_i_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE); 486 global_mode = snd_gf1_i_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE);
487 printk(" -G- GF1 global mode = 0x%x\n", global_mode); 487 printk(KERN_INFO " -G- GF1 global mode = 0x%x\n", global_mode);
488 } 488 }
489 if (global_mode & 0x02) /* LFO enabled? */ 489 if (global_mode & 0x02) /* LFO enabled? */
490 printk(" -G- GF1 LFO base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_LFO_BASE)); 490 printk(KERN_INFO " -G- GF1 LFO base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_LFO_BASE));
491 printk(" -G- GF1 voices IRQ read = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_VOICES_IRQ_READ)); 491 printk(KERN_INFO " -G- GF1 voices IRQ read = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_VOICES_IRQ_READ));
492 printk(" -G- GF1 DRAM DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL)); 492 printk(KERN_INFO " -G- GF1 DRAM DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL));
493 printk(" -G- GF1 DRAM DMA high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_HIGH), snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_DMA_LOW)); 493 printk(KERN_INFO " -G- GF1 DRAM DMA high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_HIGH), snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_DMA_LOW));
494 printk(" -G- GF1 DRAM IO high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_IO_HIGH), snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_IO_LOW)); 494 printk(KERN_INFO " -G- GF1 DRAM IO high/low = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_IO_HIGH), snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_IO_LOW));
495 if (!gus->interwave) 495 if (!gus->interwave)
496 printk(" -G- GF1 record DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL)); 496 printk(KERN_INFO " -G- GF1 record DMA control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL));
497 printk(" -G- GF1 DRAM IO 16 = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_DRAM_IO16)); 497 printk(KERN_INFO " -G- GF1 DRAM IO 16 = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_DRAM_IO16));
498 if (gus->gf1.enh_mode) { 498 if (gus->gf1.enh_mode) {
499 printk(" -G- GFA1 memory config = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG)); 499 printk(KERN_INFO " -G- GFA1 memory config = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG));
500 printk(" -G- GFA1 memory control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_MEMORY_CONTROL)); 500 printk(KERN_INFO " -G- GFA1 memory control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_MEMORY_CONTROL));
501 printk(" -G- GFA1 FIFO record base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR)); 501 printk(KERN_INFO " -G- GFA1 FIFO record base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR));
502 printk(" -G- GFA1 FIFO playback base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR)); 502 printk(KERN_INFO " -G- GFA1 FIFO playback base = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR));
503 printk(" -G- GFA1 interleave control = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_INTERLEAVE)); 503 printk(KERN_INFO " -G- GFA1 interleave control = 0x%x\n", snd_gf1_i_look16(gus, SNDRV_GF1_GW_INTERLEAVE));
504 } 504 }
505} 505}
506 506
507void snd_gf1_print_setup_registers(snd_gus_card_t * gus) 507void snd_gf1_print_setup_registers(snd_gus_card_t * gus)
508{ 508{
509 printk(" -S- mix control = 0x%x\n", inb(GUSP(gus, MIXCNTRLREG))); 509 printk(KERN_INFO " -S- mix control = 0x%x\n", inb(GUSP(gus, MIXCNTRLREG)));
510 printk(" -S- IRQ status = 0x%x\n", inb(GUSP(gus, IRQSTAT))); 510 printk(KERN_INFO " -S- IRQ status = 0x%x\n", inb(GUSP(gus, IRQSTAT)));
511 printk(" -S- timer control = 0x%x\n", inb(GUSP(gus, TIMERCNTRL))); 511 printk(KERN_INFO " -S- timer control = 0x%x\n", inb(GUSP(gus, TIMERCNTRL)));
512 printk(" -S- timer data = 0x%x\n", inb(GUSP(gus, TIMERDATA))); 512 printk(KERN_INFO " -S- timer data = 0x%x\n", inb(GUSP(gus, TIMERDATA)));
513 printk(" -S- status read = 0x%x\n", inb(GUSP(gus, REGCNTRLS))); 513 printk(KERN_INFO " -S- status read = 0x%x\n", inb(GUSP(gus, REGCNTRLS)));
514 printk(" -S- Sound Blaster control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL)); 514 printk(KERN_INFO " -S- Sound Blaster control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL));
515 printk(" -S- AdLib timer 1/2 = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1), snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2)); 515 printk(KERN_INFO " -S- AdLib timer 1/2 = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1), snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2));
516 printk(" -S- reset = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)); 516 printk(KERN_INFO " -S- reset = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET));
517 if (gus->interwave) { 517 if (gus->interwave) {
518 printk(" -S- compatibility = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_COMPATIBILITY)); 518 printk(KERN_INFO " -S- compatibility = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_COMPATIBILITY));
519 printk(" -S- decode control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DECODE_CONTROL)); 519 printk(KERN_INFO " -S- decode control = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_DECODE_CONTROL));
520 printk(" -S- version number = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER)); 520 printk(KERN_INFO " -S- version number = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER));
521 printk(" -S- MPU-401 emul. control A/B = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A), snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B)); 521 printk(KERN_INFO " -S- MPU-401 emul. control A/B = 0x%x/0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A), snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B));
522 printk(" -S- emulation IRQ = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_EMULATION_IRQ)); 522 printk(KERN_INFO " -S- emulation IRQ = 0x%x\n", snd_gf1_i_look8(gus, SNDRV_GF1_GB_EMULATION_IRQ));
523 } 523 }
524} 524}
525 525
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index 8f2872f8e8f6..4f57ff4ab351 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -113,14 +113,8 @@ static int snd_gus_free(snd_gus_card_t *gus)
113 snd_gf1_stop(gus); 113 snd_gf1_stop(gus);
114 snd_gus_init_dma_irq(gus, 0); 114 snd_gus_init_dma_irq(gus, 0);
115 __hw_end: 115 __hw_end:
116 if (gus->gf1.res_port1) { 116 release_and_free_resource(gus->gf1.res_port1);
117 release_resource(gus->gf1.res_port1); 117 release_and_free_resource(gus->gf1.res_port2);
118 kfree_nocheck(gus->gf1.res_port1);
119 }
120 if (gus->gf1.res_port2) {
121 release_resource(gus->gf1.res_port2);
122 kfree_nocheck(gus->gf1.res_port2);
123 }
124 if (gus->gf1.irq >= 0) 118 if (gus->gf1.irq >= 0)
125 free_irq(gus->gf1.irq, (void *) gus); 119 free_irq(gus->gf1.irq, (void *) gus);
126 if (gus->gf1.dma1 >= 0) { 120 if (gus->gf1.dma1 >= 0) {
@@ -252,7 +246,7 @@ static int snd_gus_detect_memory(snd_gus_card_t * gus)
252 snd_gf1_poke(gus, 0L, 0xaa); 246 snd_gf1_poke(gus, 0L, 0xaa);
253 snd_gf1_poke(gus, 1L, 0x55); 247 snd_gf1_poke(gus, 1L, 0x55);
254 if (snd_gf1_peek(gus, 0L) != 0xaa || snd_gf1_peek(gus, 1L) != 0x55) { 248 if (snd_gf1_peek(gus, 0L) != 0xaa || snd_gf1_peek(gus, 1L) != 0x55) {
255 snd_printk("plain GF1 card at 0x%lx without onboard DRAM?\n", gus->gf1.port); 249 snd_printk(KERN_ERR "plain GF1 card at 0x%lx without onboard DRAM?\n", gus->gf1.port);
256 return -ENOMEM; 250 return -ENOMEM;
257 } 251 }
258 for (idx = 1, d = 0xab; idx < 4; idx++, d++) { 252 for (idx = 1, d = 0xab; idx < 4; idx++, d++) {
@@ -305,20 +299,17 @@ static int snd_gus_init_dma_irq(snd_gus_card_t * gus, int latches)
305 dma2 = gus->gf1.dma2; 299 dma2 = gus->gf1.dma2;
306 dma2 = dma2 < 0 ? -dma2 : dma2; 300 dma2 = dma2 < 0 ? -dma2 : dma2;
307 dma2 = dmas[dma2 & 7]; 301 dma2 = dmas[dma2 & 7];
308#if 0
309 printk("dma1 = %i, dma2 = %i\n", gus->gf1.dma1, gus->gf1.dma2);
310#endif
311 dma1 |= gus->equal_dma ? 0x40 : (dma2 << 3); 302 dma1 |= gus->equal_dma ? 0x40 : (dma2 << 3);
312 303
313 if ((dma1 & 7) == 0 || (dma2 & 7) == 0) { 304 if ((dma1 & 7) == 0 || (dma2 & 7) == 0) {
314 snd_printk("Error! DMA isn't defined.\n"); 305 snd_printk(KERN_ERR "Error! DMA isn't defined.\n");
315 return -EINVAL; 306 return -EINVAL;
316 } 307 }
317 irq = gus->gf1.irq; 308 irq = gus->gf1.irq;
318 irq = irq < 0 ? -irq : irq; 309 irq = irq < 0 ? -irq : irq;
319 irq = irqs[irq & 0x0f]; 310 irq = irqs[irq & 0x0f];
320 if (irq == 0) { 311 if (irq == 0) {
321 snd_printk("Error! IRQ isn't defined.\n"); 312 snd_printk(KERN_ERR "Error! IRQ isn't defined.\n");
322 return -EINVAL; 313 return -EINVAL;
323 } 314 }
324 irq |= 0x40; 315 irq |= 0x40;
@@ -406,8 +397,8 @@ static int snd_gus_check_version(snd_gus_card_t * gus)
406 strcpy(card->longname, "Gravis UltraSound Extreme"); 397 strcpy(card->longname, "Gravis UltraSound Extreme");
407 gus->ess_flag = 1; 398 gus->ess_flag = 1;
408 } else { 399 } else {
409 snd_printk("unknown GF1 revision number at 0x%lx - 0x%x (0x%x)\n", gus->gf1.port, rev, val); 400 snd_printk(KERN_ERR "unknown GF1 revision number at 0x%lx - 0x%x (0x%x)\n", gus->gf1.port, rev, val);
410 snd_printk(" please - report to <perex@suse.cz>\n"); 401 snd_printk(KERN_ERR " please - report to <perex@suse.cz>\n");
411 } 402 }
412 } 403 }
413 } 404 }
@@ -431,7 +422,7 @@ int snd_gus_initialize(snd_gus_card_t *gus)
431 422
432 if (!gus->interwave) { 423 if (!gus->interwave) {
433 if ((err = snd_gus_check_version(gus)) < 0) { 424 if ((err = snd_gus_check_version(gus)) < 0) {
434 snd_printk("version check failed\n"); 425 snd_printk(KERN_ERR "version check failed\n");
435 return err; 426 return err;
436 } 427 }
437 if ((err = snd_gus_detect_memory(gus)) < 0) 428 if ((err = snd_gus_detect_memory(gus)) < 0)
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
index 5eb766dd564b..2e23f2a8c627 100644
--- a/sound/isa/gus/gus_mem.c
+++ b/sound/isa/gus/gus_mem.c
@@ -198,7 +198,7 @@ snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner,
198 if (nblock != NULL) { 198 if (nblock != NULL) {
199 if (size != (int)nblock->size) { 199 if (size != (int)nblock->size) {
200 /* TODO: remove in the future */ 200 /* TODO: remove in the future */
201 snd_printk("snd_gf1_mem_alloc - share: sizes differ\n"); 201 snd_printk(KERN_ERR "snd_gf1_mem_alloc - share: sizes differ\n");
202 goto __std; 202 goto __std;
203 } 203 }
204 nblock->share++; 204 nblock->share++;
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index beb01365dc46..1cc89fb67bf2 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -333,8 +333,7 @@ static int snd_gf1_pcm_poke_block(snd_gus_card_t *gus, unsigned char *buf,
333 } 333 }
334 } 334 }
335 if (count > 0 && !in_interrupt()) { 335 if (count > 0 && !in_interrupt()) {
336 set_current_state(TASK_INTERRUPTIBLE); 336 schedule_timeout_interruptible(1);
337 schedule_timeout(1);
338 if (signal_pending(current)) 337 if (signal_pending(current))
339 return -EAGAIN; 338 return -EAGAIN;
340 } 339 }
@@ -698,7 +697,7 @@ static int snd_gf1_pcm_playback_close(snd_pcm_substream_t * substream)
698 gus_pcm_private_t *pcmp = runtime->private_data; 697 gus_pcm_private_t *pcmp = runtime->private_data;
699 698
700 if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ)) 699 if (!wait_event_timeout(pcmp->sleep, (atomic_read(&pcmp->dma_count) <= 0), 2*HZ))
701 snd_printk("gf1 pcm - serious DMA problem\n"); 700 snd_printk(KERN_ERR "gf1 pcm - serious DMA problem\n");
702 701
703 snd_gf1_dma_done(gus); 702 snd_gf1_dma_done(gus);
704 return 0; 703 return 0;
diff --git a/sound/isa/gus/gus_reset.c b/sound/isa/gus/gus_reset.c
index ef687abc7070..90710969ef7f 100644
--- a/sound/isa/gus/gus_reset.c
+++ b/sound/isa/gus/gus_reset.c
@@ -134,7 +134,7 @@ void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice)
134 spin_lock_irqsave(&gus->reg_lock, flags); 134 spin_lock_irqsave(&gus->reg_lock, flags);
135 snd_gf1_select_voice(gus, voice); 135 snd_gf1_select_voice(gus, voice);
136#if 0 136#if 0
137 printk(" -%i- smart stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME)); 137 printk(KERN_DEBUG " -%i- smart stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME));
138#endif 138#endif
139 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL); 139 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL);
140 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 140 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
@@ -148,7 +148,7 @@ void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice)
148 spin_lock_irqsave(&gus->reg_lock, flags); 148 spin_lock_irqsave(&gus->reg_lock, flags);
149 snd_gf1_select_voice(gus, voice); 149 snd_gf1_select_voice(gus, voice);
150#if 0 150#if 0
151 printk(" -%i- stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME)); 151 printk(KERN_DEBUG " -%i- stop voice - volume = 0x%x\n", voice, snd_gf1_i_read16(gus, SNDRV_GF1_VW_VOLUME));
152#endif 152#endif
153 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL); 153 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_ADDRESS_CONTROL);
154 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 154 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
diff --git a/sound/isa/gus/gus_simple.c b/sound/isa/gus/gus_simple.c
index c122e7be6ceb..dfed85b58b3a 100644
--- a/sound/isa/gus/gus_simple.c
+++ b/sound/isa/gus/gus_simple.c
@@ -136,7 +136,7 @@ static void do_volume_envelope(snd_gus_card_t *gus, snd_gus_voice_t *voice)
136 snd_gf1_select_voice(gus, voice->number); 136 snd_gf1_select_voice(gus, voice->number);
137 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 137 snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);
138 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, voice->gf1_volume); 138 snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, voice->gf1_volume);
139 printk("gf1_volume = 0x%x\n", voice->gf1_volume); 139 /* printk("gf1_volume = 0x%x\n", voice->gf1_volume); */
140 spin_unlock_irqrestore(&gus->reg_lock, flags); 140 spin_unlock_irqrestore(&gus->reg_lock, flags);
141 return; 141 return;
142 } 142 }
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c
index 1bc2da8784e0..fbc95e99105c 100644
--- a/sound/isa/gus/gus_uart.c
+++ b/sound/isa/gus/gus_uart.c
@@ -104,7 +104,7 @@ static int snd_gf1_uart_output_open(snd_rawmidi_substream_t * substream)
104 gus->midi_substream_output = substream; 104 gus->midi_substream_output = substream;
105 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); 105 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
106#if 0 106#if 0
107 snd_printk("write init - cmd = 0x%x, stat = 0x%x\n", gus->gf1.uart_cmd, snd_gf1_uart_stat(gus)); 107 snd_printk(KERN_DEBUG "write init - cmd = 0x%x, stat = 0x%x\n", gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
108#endif 108#endif
109 return 0; 109 return 0;
110} 110}
@@ -126,7 +126,7 @@ static int snd_gf1_uart_input_open(snd_rawmidi_substream_t * substream)
126 for (i = 0; i < 1000 && (snd_gf1_uart_stat(gus) & 0x01); i++) 126 for (i = 0; i < 1000 && (snd_gf1_uart_stat(gus) & 0x01); i++)
127 snd_gf1_uart_get(gus); /* clean Rx */ 127 snd_gf1_uart_get(gus); /* clean Rx */
128 if (i >= 1000) 128 if (i >= 1000)
129 snd_printk("gus midi uart init read - cleanup error\n"); 129 snd_printk(KERN_ERR "gus midi uart init read - cleanup error\n");
130 } 130 }
131 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); 131 spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
132#if 0 132#if 0
diff --git a/sound/isa/gus/gus_volume.c b/sound/isa/gus/gus_volume.c
index 3d36f6c8ee6a..b3382fec5298 100644
--- a/sound/isa/gus/gus_volume.c
+++ b/sound/isa/gus/gus_volume.c
@@ -119,7 +119,7 @@ unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq16)
119 freq16 = 50; 119 freq16 = 50;
120 if (freq16 & 0xf8000000) { 120 if (freq16 & 0xf8000000) {
121 freq16 = ~0xf8000000; 121 freq16 = ~0xf8000000;
122 snd_printk("snd_gf1_translate_freq: overflow - freq = 0x%x\n", freq16); 122 snd_printk(KERN_ERR "snd_gf1_translate_freq: overflow - freq = 0x%x\n", freq16);
123 } 123 }
124 return ((freq16 << 9) + (gus->gf1.playback_freq >> 1)) / gus->gf1.playback_freq; 124 return ((freq16 << 9) + (gus->gf1.playback_freq >> 1)) / gus->gf1.playback_freq;
125} 125}
@@ -203,14 +203,14 @@ unsigned short snd_gf1_compute_freq(unsigned int freq,
203 fc = (freq << 10) / rate; 203 fc = (freq << 10) / rate;
204 if (fc > 97391L) { 204 if (fc > 97391L) {
205 fc = 97391; 205 fc = 97391;
206 snd_printk("patch: (1) fc frequency overflow - %u\n", fc); 206 snd_printk(KERN_ERR "patch: (1) fc frequency overflow - %u\n", fc);
207 } 207 }
208 fc = (fc * 44100UL) / mix_rate; 208 fc = (fc * 44100UL) / mix_rate;
209 while (scale--) 209 while (scale--)
210 fc <<= 1; 210 fc <<= 1;
211 if (fc > 65535L) { 211 if (fc > 65535L) {
212 fc = 65535; 212 fc = 65535;
213 snd_printk("patch: (2) fc frequency overflow - %u\n", fc); 213 snd_printk(KERN_ERR "patch: (2) fc frequency overflow - %u\n", fc);
214 } 214 }
215 return (unsigned short) fc; 215 return (unsigned short) fc;
216} 216}
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 358cba9d738f..f703a9f4257c 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -437,7 +437,7 @@ static void __devinit snd_interwave_detect_memory(snd_gus_card_t * gus)
437 for (i = 0; i < 8; ++i) 437 for (i = 0; i < 8; ++i)
438 iwave[i] = snd_gf1_peek(gus, bank_pos + i); 438 iwave[i] = snd_gf1_peek(gus, bank_pos + i);
439#ifdef CONFIG_SND_DEBUG_ROM 439#ifdef CONFIG_SND_DEBUG_ROM
440 printk("ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos, 440 printk(KERN_DEBUG "ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos,
441 iwave[0], iwave[1], iwave[2], iwave[3], 441 iwave[0], iwave[1], iwave[2], iwave[3],
442 iwave[4], iwave[5], iwave[6], iwave[7]); 442 iwave[4], iwave[5], iwave[6], iwave[7]);
443#endif 443#endif
@@ -447,7 +447,7 @@ static void __devinit snd_interwave_detect_memory(snd_gus_card_t * gus)
447 for (i = 0; i < sizeof(struct rom_hdr); i++) 447 for (i = 0; i < sizeof(struct rom_hdr); i++)
448 csum += snd_gf1_peek(gus, bank_pos + i); 448 csum += snd_gf1_peek(gus, bank_pos + i);
449#ifdef CONFIG_SND_DEBUG_ROM 449#ifdef CONFIG_SND_DEBUG_ROM
450 printk("ROM checksum = 0x%x (computed)\n", csum); 450 printk(KERN_DEBUG "ROM checksum = 0x%x (computed)\n", csum);
451#endif 451#endif
452 if (csum != 0) 452 if (csum != 0)
453 continue; /* not valid rom */ 453 continue; /* not valid rom */
@@ -638,10 +638,7 @@ static void snd_interwave_free(snd_card_t *card)
638 if (iwcard == NULL) 638 if (iwcard == NULL)
639 return; 639 return;
640#ifdef SNDRV_STB 640#ifdef SNDRV_STB
641 if (iwcard->i2c_res) { 641 release_and_free_resource(iwcard->i2c_res);
642 release_resource(iwcard->i2c_res);
643 kfree_nocheck(iwcard->i2c_res);
644 }
645#endif 642#endif
646 if (iwcard->irq >= 0) 643 if (iwcard->irq >= 0)
647 free_irq(iwcard->irq, (void *)iwcard); 644 free_irq(iwcard->irq, (void *)iwcard);
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 4ba268f251e3..47cabda792b6 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -656,10 +656,7 @@ static int snd_opl3sa2_free(opl3sa2_t *chip)
656{ 656{
657 if (chip->irq >= 0) 657 if (chip->irq >= 0)
658 free_irq(chip->irq, (void *)chip); 658 free_irq(chip->irq, (void *)chip);
659 if (chip->res_port) { 659 release_and_free_resource(chip->res_port);
660 release_resource(chip->res_port);
661 kfree_nocheck(chip->res_port);
662 }
663 kfree(chip); 660 kfree(chip);
664 return 0; 661 return 0;
665} 662}
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 73573cb1db6a..b94339f8306f 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -299,10 +299,8 @@ static char * snd_opti9xx_names[] = {
299static long snd_legacy_find_free_ioport(long *port_table, long size) 299static long snd_legacy_find_free_ioport(long *port_table, long size)
300{ 300{
301 while (*port_table != -1) { 301 while (*port_table != -1) {
302 struct resource *res; 302 if (request_region(*port_table, size, "ALSA test")) {
303 if ((res = request_region(*port_table, size, "ALSA test")) != NULL) { 303 release_region(*port_table, size);
304 release_resource(res);
305 kfree_nocheck(res);
306 return *port_table; 304 return *port_table;
307 } 305 }
308 port_table++; 306 port_table++;
@@ -1227,10 +1225,7 @@ static int snd_opti93x_probe(opti93x_t *chip)
1227 1225
1228static int snd_opti93x_free(opti93x_t *chip) 1226static int snd_opti93x_free(opti93x_t *chip)
1229{ 1227{
1230 if (chip->res_port) { 1228 release_and_free_resource(chip->res_port);
1231 release_resource(chip->res_port);
1232 kfree_nocheck(chip->res_port);
1233 }
1234 if (chip->dma1 >= 0) { 1229 if (chip->dma1 >= 0) {
1235 disable_dma(chip->dma1); 1230 disable_dma(chip->dma1);
1236 free_dma(chip->dma1); 1231 free_dma(chip->dma1);
@@ -1656,8 +1651,7 @@ static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
1656 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) 1651 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
1657 return 1; 1652 return 1;
1658 1653
1659 release_resource(chip->res_mc_base); 1654 release_and_free_resource(chip->res_mc_base);
1660 kfree_nocheck(chip->res_mc_base);
1661 chip->res_mc_base = NULL; 1655 chip->res_mc_base = NULL;
1662 1656
1663 } 1657 }
@@ -1683,8 +1677,7 @@ static int __devinit snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
1683 if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value) 1677 if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value)
1684 return 1; 1678 return 1;
1685 1679
1686 release_resource(chip->res_mc_base); 1680 release_and_free_resource(chip->res_mc_base);
1687 kfree_nocheck(chip->res_mc_base);
1688 chip->res_mc_base = NULL; 1681 chip->res_mc_base = NULL;
1689 } 1682 }
1690#endif /* OPTi93X */ 1683#endif /* OPTi93X */
@@ -1886,12 +1879,8 @@ static void snd_card_opti9xx_free(snd_card_t *card)
1886{ 1879{
1887 opti9xx_t *chip = (opti9xx_t *)card->private_data; 1880 opti9xx_t *chip = (opti9xx_t *)card->private_data;
1888 1881
1889 if (chip) { 1882 if (chip)
1890 if (chip->res_mc_base) { 1883 release_and_free_resource(chip->res_mc_base);
1891 release_resource(chip->res_mc_base);
1892 kfree_nocheck(chip->res_mc_base);
1893 }
1894 }
1895} 1884}
1896 1885
1897static int snd_card_opti9xx_probe(struct pnp_card_link *pcard, 1886static int snd_card_opti9xx_probe(struct pnp_card_link *pcard,
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index 5375705c054b..b09c6575e01a 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -135,8 +135,7 @@ static void __init
135snd_emu8000_read_wait(emu8000_t *emu) 135snd_emu8000_read_wait(emu8000_t *emu)
136{ 136{
137 while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) { 137 while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) {
138 set_current_state(TASK_INTERRUPTIBLE); 138 schedule_timeout_interruptible(1);
139 schedule_timeout(1);
140 if (signal_pending(current)) 139 if (signal_pending(current))
141 break; 140 break;
142 } 141 }
@@ -148,8 +147,7 @@ static void __init
148snd_emu8000_write_wait(emu8000_t *emu) 147snd_emu8000_write_wait(emu8000_t *emu)
149{ 148{
150 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { 149 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
151 set_current_state(TASK_INTERRUPTIBLE); 150 schedule_timeout_interruptible(1);
152 schedule_timeout(1);
153 if (signal_pending(current)) 151 if (signal_pending(current))
154 break; 152 break;
155 } 153 }
@@ -437,8 +435,7 @@ size_dram(emu8000_t *emu)
437 for (i = 0; i < 10000; i++) { 435 for (i = 0; i < 10000; i++) {
438 if ((EMU8000_SMALW_READ(emu) & 0x80000000) == 0) 436 if ((EMU8000_SMALW_READ(emu) & 0x80000000) == 0)
439 break; 437 break;
440 set_current_state(TASK_INTERRUPTIBLE); 438 schedule_timeout_interruptible(1);
441 schedule_timeout(1);
442 if (signal_pending(current)) 439 if (signal_pending(current))
443 break; 440 break;
444 } 441 }
@@ -1054,18 +1051,9 @@ __error:
1054 */ 1051 */
1055static int snd_emu8000_free(emu8000_t *hw) 1052static int snd_emu8000_free(emu8000_t *hw)
1056{ 1053{
1057 if (hw->res_port1) { 1054 release_and_free_resource(hw->res_port1);
1058 release_resource(hw->res_port1); 1055 release_and_free_resource(hw->res_port2);
1059 kfree_nocheck(hw->res_port1); 1056 release_and_free_resource(hw->res_port3);
1060 }
1061 if (hw->res_port2) {
1062 release_resource(hw->res_port2);
1063 kfree_nocheck(hw->res_port2);
1064 }
1065 if (hw->res_port3) {
1066 release_resource(hw->res_port3);
1067 kfree_nocheck(hw->res_port3);
1068 }
1069 kfree(hw); 1057 kfree(hw);
1070 return 0; 1058 return 0;
1071} 1059}
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index 26e693078cb3..2fea67e71c78 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -109,8 +109,7 @@ static void
109snd_emu8000_write_wait(emu8000_t *emu) 109snd_emu8000_write_wait(emu8000_t *emu)
110{ 110{
111 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { 111 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
112 set_current_state(TASK_INTERRUPTIBLE); 112 schedule_timeout_interruptible(1);
113 schedule_timeout(1);
114 if (signal_pending(current)) 113 if (signal_pending(current))
115 break; 114 break;
116 } 115 }
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
index 0209790dc4b5..b323beeeda15 100644
--- a/sound/isa/sb/emu8000_pcm.c
+++ b/sound/isa/sb/emu8000_pcm.c
@@ -117,8 +117,7 @@ snd_emu8000_write_wait(emu8000_t *emu, int can_schedule)
117{ 117{
118 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { 118 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
119 if (can_schedule) { 119 if (can_schedule) {
120 set_current_state(TASK_INTERRUPTIBLE); 120 schedule_timeout_interruptible(1);
121 schedule_timeout(1);
122 if (signal_pending(current)) 121 if (signal_pending(current))
123 break; 122 break;
124 } 123 }
diff --git a/sound/isa/sb/emu8000_synth.c b/sound/isa/sb/emu8000_synth.c
index 1f63aa52d596..f68e217416a6 100644
--- a/sound/isa/sb/emu8000_synth.c
+++ b/sound/isa/sb/emu8000_synth.c
@@ -56,7 +56,7 @@ static int snd_emu8000_new_device(snd_seq_device_t *dev)
56 emu->num_ports = hw->seq_ports; 56 emu->num_ports = hw->seq_ports;
57 57
58 if (hw->memhdr) { 58 if (hw->memhdr) {
59 snd_printk("memhdr is already initialized!?\n"); 59 snd_printk(KERN_ERR "memhdr is already initialized!?\n");
60 snd_util_memhdr_free(hw->memhdr); 60 snd_util_memhdr_free(hw->memhdr);
61 } 61 }
62 hw->memhdr = snd_util_memhdr_new(hw->mem_size); 62 hw->memhdr = snd_util_memhdr_new(hw->mem_size);
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index 7888783d68f5..c2fa451bc8f0 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -345,10 +345,7 @@ static void snd_sb16_free(snd_card_t *card)
345 345
346 if (acard == NULL) 346 if (acard == NULL)
347 return; 347 return;
348 if (acard->fm_res) { 348 release_and_free_resource(acard->fm_res);
349 release_resource(acard->fm_res);
350 kfree_nocheck(acard->fm_res);
351 }
352} 349}
353 350
354#ifdef CONFIG_PNP 351#ifdef CONFIG_PNP
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index a99e642a68b5..556b95e3e22f 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -747,7 +747,7 @@ int snd_sb16dsp_configure(sb_t * chip)
747 unsigned char realirq, realdma, realmpureg; 747 unsigned char realirq, realdma, realmpureg;
748 /* note: mpu register should be present only on SB16 Vibra soundcards */ 748 /* note: mpu register should be present only on SB16 Vibra soundcards */
749 749
750 // printk("codec->irq=%i, codec->dma8=%i, codec->dma16=%i\n", chip->irq, chip->dma8, chip->dma16); 750 // printk(KERN_DEBUG "codec->irq=%i, codec->dma8=%i, codec->dma16=%i\n", chip->irq, chip->dma8, chip->dma16);
751 spin_lock_irqsave(&chip->mixer_lock, flags); 751 spin_lock_irqsave(&chip->mixer_lock, flags);
752 mpureg = snd_sbmixer_read(chip, SB_DSP4_MPUSETUP) & ~0x06; 752 mpureg = snd_sbmixer_read(chip, SB_DSP4_MPUSETUP) & ~0x06;
753 spin_unlock_irqrestore(&chip->mixer_lock, flags); 753 spin_unlock_irqrestore(&chip->mixer_lock, flags);
@@ -821,9 +821,9 @@ int snd_sb16dsp_configure(sb_t * chip)
821 821
822 spin_unlock_irqrestore(&chip->mixer_lock, flags); 822 spin_unlock_irqrestore(&chip->mixer_lock, flags);
823 if ((~realirq) & irqreg || (~realdma) & dmareg) { 823 if ((~realirq) & irqreg || (~realdma) & dmareg) {
824 snd_printk("SB16 [0x%lx]: unable to set DMA & IRQ (PnP device?)\n", chip->port); 824 snd_printk(KERN_ERR "SB16 [0x%lx]: unable to set DMA & IRQ (PnP device?)\n", chip->port);
825 snd_printk("SB16 [0x%lx]: wanted: irqreg=0x%x, dmareg=0x%x, mpureg = 0x%x\n", chip->port, realirq, realdma, realmpureg); 825 snd_printk(KERN_ERR "SB16 [0x%lx]: wanted: irqreg=0x%x, dmareg=0x%x, mpureg = 0x%x\n", chip->port, realirq, realdma, realmpureg);
826 snd_printk("SB16 [0x%lx]: got: irqreg=0x%x, dmareg=0x%x, mpureg = 0x%x\n", chip->port, irqreg, dmareg, mpureg); 826 snd_printk(KERN_ERR "SB16 [0x%lx]: got: irqreg=0x%x, dmareg=0x%x, mpureg = 0x%x\n", chip->port, irqreg, dmareg, mpureg);
827 return -ENODEV; 827 return -ENODEV;
828 } 828 }
829 return 0; 829 return 0;
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index c41ac25e85ca..0bc0a3afdabc 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -78,10 +78,7 @@ static void snd_sb8_free(snd_card_t *card)
78 78
79 if (acard == NULL) 79 if (acard == NULL)
80 return; 80 return;
81 if (acard->fm_res) { 81 release_and_free_resource(acard->fm_res);
82 release_resource(acard->fm_res);
83 kfree_nocheck(acard->fm_res);
84 }
85} 82}
86 83
87static int __init snd_sb8_probe(int dev) 84static int __init snd_sb8_probe(int dev)
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 87c9b1ba06cf..5ddc6e41d909 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -334,9 +334,6 @@ irqreturn_t snd_sb8dsp_interrupt(sb_t *chip)
334 snd_pcm_substream_t *substream; 334 snd_pcm_substream_t *substream;
335 snd_pcm_runtime_t *runtime; 335 snd_pcm_runtime_t *runtime;
336 336
337#if 0
338 snd_printk("sb8: interrupt\n");
339#endif
340 snd_sb_ack_8bit(chip); 337 snd_sb_ack_8bit(chip);
341 switch (chip->mode) { 338 switch (chip->mode) {
342 case SB_MODE_PLAYBACK_8: /* ok.. playback is active */ 339 case SB_MODE_PLAYBACK_8: /* ok.. playback is active */
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index f0f205ae425f..603e923b5d2f 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -45,7 +45,7 @@ int snd_sbdsp_command(sb_t *chip, unsigned char val)
45{ 45{
46 int i; 46 int i;
47#ifdef IO_DEBUG 47#ifdef IO_DEBUG
48 snd_printk("command 0x%x\n", val); 48 snd_printk(KERN_DEBUG "command 0x%x\n", val);
49#endif 49#endif
50 for (i = BUSY_LOOPS; i; i--) 50 for (i = BUSY_LOOPS; i; i--)
51 if ((inb(SBP(chip, STATUS)) & 0x80) == 0) { 51 if ((inb(SBP(chip, STATUS)) & 0x80) == 0) {
@@ -64,7 +64,7 @@ int snd_sbdsp_get_byte(sb_t *chip)
64 if (inb(SBP(chip, DATA_AVAIL)) & 0x80) { 64 if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
65 val = inb(SBP(chip, READ)); 65 val = inb(SBP(chip, READ));
66#ifdef IO_DEBUG 66#ifdef IO_DEBUG
67 snd_printk("get_byte 0x%x\n", val); 67 snd_printk(KERN_DEBUG "get_byte 0x%x\n", val);
68#endif 68#endif
69 return val; 69 return val;
70 } 70 }
@@ -154,7 +154,7 @@ static int snd_sbdsp_probe(sb_t * chip)
154 str = "16"; 154 str = "16";
155 break; 155 break;
156 default: 156 default:
157 snd_printk("SB [0x%lx]: unknown DSP chip version %i.%i\n", 157 snd_printk(KERN_INFO "SB [0x%lx]: unknown DSP chip version %i.%i\n",
158 chip->port, major, minor); 158 chip->port, major, minor);
159 return -ENODEV; 159 return -ENODEV;
160 } 160 }
@@ -178,10 +178,8 @@ static int snd_sbdsp_probe(sb_t * chip)
178 178
179static int snd_sbdsp_free(sb_t *chip) 179static int snd_sbdsp_free(sb_t *chip)
180{ 180{
181 if (chip->res_port) { 181 if (chip->res_port)
182 release_resource(chip->res_port); 182 release_and_free_resource(chip->res_port);
183 kfree_nocheck(chip->res_port);
184 }
185 if (chip->irq >= 0) 183 if (chip->irq >= 0)
186 free_irq(chip->irq, (void *) chip); 184 free_irq(chip->irq, (void *) chip);
187#ifdef CONFIG_ISA 185#ifdef CONFIG_ISA
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index ff4b59968027..5a926a452d38 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -36,7 +36,7 @@ void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data)
36 outb(data, SBP(chip, MIXER_DATA)); 36 outb(data, SBP(chip, MIXER_DATA));
37 udelay(10); 37 udelay(10);
38#ifdef IO_DEBUG 38#ifdef IO_DEBUG
39 snd_printk("mixer_write 0x%x 0x%x\n", reg, data); 39 snd_printk(KERN_DEBUG "mixer_write 0x%x 0x%x\n", reg, data);
40#endif 40#endif
41} 41}
42 42
@@ -49,7 +49,7 @@ unsigned char snd_sbmixer_read(sb_t *chip, unsigned char reg)
49 result = inb(SBP(chip, MIXER_DATA)); 49 result = inb(SBP(chip, MIXER_DATA));
50 udelay(10); 50 udelay(10);
51#ifdef IO_DEBUG 51#ifdef IO_DEBUG
52 snd_printk("mixer_read 0x%x 0x%x\n", reg, result); 52 snd_printk(KERN_DEBUG "mixer_read 0x%x 0x%x\n", reg, result);
53#endif 53#endif
54 return result; 54 return result;
55} 55}
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 9f6b58c79209..11588067fa4f 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -338,25 +338,11 @@ static inline void activate_ad1845_unsafe(unsigned io_base)
338static void soundscape_free(snd_card_t * c) 338static void soundscape_free(snd_card_t * c)
339{ 339{
340 register struct soundscape *sscape = get_card_soundscape(c); 340 register struct soundscape *sscape = get_card_soundscape(c);
341 release_resource(sscape->io_res); 341 release_and_free_resource(sscape->io_res);
342 kfree_nocheck(sscape->io_res);
343 free_dma(sscape->chip->dma1); 342 free_dma(sscape->chip->dma1);
344} 343}
345 344
346/* 345/*
347 * Put this process into an idle wait-state for a certain number
348 * of "jiffies". The process can almost certainly be rescheduled
349 * while we're waiting, and so we must NOT be holding any spinlocks
350 * when we call this function. If we are then we risk DEADLOCK in
351 * SMP (Ha!) or pre-emptible kernels.
352 */
353static inline void sleep(long jiffs, int state)
354{
355 set_current_state(state);
356 schedule_timeout(jiffs);
357}
358
359/*
360 * Tell the SoundScape to begin a DMA tranfer using the given channel. 346 * Tell the SoundScape to begin a DMA tranfer using the given channel.
361 * All locking issues are left to the caller. 347 * All locking issues are left to the caller.
362 */ 348 */
@@ -393,7 +379,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout)
393 unsigned long flags; 379 unsigned long flags;
394 unsigned char x; 380 unsigned char x;
395 381
396 sleep(1, TASK_INTERRUPTIBLE); 382 schedule_timeout_interruptible(1);
397 383
398 spin_lock_irqsave(&s->lock, flags); 384 spin_lock_irqsave(&s->lock, flags);
399 x = inb(HOST_DATA_IO(s->io_base)); 385 x = inb(HOST_DATA_IO(s->io_base));
@@ -420,7 +406,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout)
420 unsigned long flags; 406 unsigned long flags;
421 unsigned char x; 407 unsigned char x;
422 408
423 sleep(1, TASK_INTERRUPTIBLE); 409 schedule_timeout_interruptible(1);
424 410
425 spin_lock_irqsave(&s->lock, flags); 411 spin_lock_irqsave(&s->lock, flags);
426 x = inb(HOST_DATA_IO(s->io_base)); 412 x = inb(HOST_DATA_IO(s->io_base));
@@ -1288,8 +1274,7 @@ static int __devinit create_sscape(const struct params *params, snd_card_t **rca
1288 free_dma(params->dma1); 1274 free_dma(params->dma1);
1289 1275
1290 _release_region: 1276 _release_region:
1291 release_resource(io_res); 1277 release_and_free_resource(io_res);
1292 kfree_nocheck(io_res);
1293 1278
1294 return err; 1279 return err;
1295} 1280}
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 0a572e0a47e6..1818f1013c3f 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -379,10 +379,7 @@ snd_wavefront_free(snd_card_t *card)
379 snd_wavefront_card_t *acard = (snd_wavefront_card_t *)card->private_data; 379 snd_wavefront_card_t *acard = (snd_wavefront_card_t *)card->private_data;
380 380
381 if (acard) { 381 if (acard) {
382 if (acard->wavefront.res_base != NULL) { 382 release_and_free_resource(acard->wavefront.res_base);
383 release_resource(acard->wavefront.res_base);
384 kfree_nocheck(acard->wavefront.res_base);
385 }
386 if (acard->wavefront.irq > 0) 383 if (acard->wavefront.irq > 0)
387 free_irq(acard->wavefront.irq, (void *)acard); 384 free_irq(acard->wavefront.irq, (void *)acard);
388 } 385 }
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 0c3c951009d8..abd79b781412 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -275,8 +275,7 @@ static int
275wavefront_sleep (int limit) 275wavefront_sleep (int limit)
276 276
277{ 277{
278 set_current_state(TASK_INTERRUPTIBLE); 278 schedule_timeout_interruptible(limit);
279 schedule_timeout(limit);
280 279
281 return signal_pending(current); 280 return signal_pending(current);
282} 281}
@@ -1788,8 +1787,7 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev,
1788 outb (val,port); 1787 outb (val,port);
1789 spin_unlock_irq(&dev->irq_lock); 1788 spin_unlock_irq(&dev->irq_lock);
1790 while (1) { 1789 while (1) {
1791 set_current_state(TASK_INTERRUPTIBLE); 1790 if ((timeout = schedule_timeout_interruptible(timeout)) == 0)
1792 if ((timeout = schedule_timeout(timeout)) == 0)
1793 return; 1791 return;
1794 if (dev->irq_ok) 1792 if (dev->irq_ok)
1795 return; 1793 return;