diff options
Diffstat (limited to 'sound/isa/gus/gus_main.c')
-rw-r--r-- | sound/isa/gus/gus_main.c | 25 |
1 files changed, 8 insertions, 17 deletions
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) |