Messages in this thread Patch in this message | | | Date | Wed, 15 Mar 2000 20:37:29 -0800 (PST) | From | Paul Laufer <> | Subject | [Patch] Soundblaster mixer counter, 2.3.99-pre1 |
| |
Alan, Christoph, and l-k,
The split of sb.o into sb.o and sb_lib.o in 2.3.50 has generated at least one problem. The variable sbmixnum is never decremented when sb.o is removed. This used to not be a problem because it was inside sb.o. Now that sb.o can be removed and sb_lib.o still be there, errors such as the following appear after loading and unloading sb.o several times:
hal9000:~# modprobe sb sb: ISAPnP reports 'Creative SB32 PnP' at i/o 0x220, irq 5, dma 1, 5 Sound: Too many mixers (SB_6)
Also when going through the code I found another mixer counter (num_mixers) in dev_tables.c that was not being decremented on mixer removal.
The attached patch fixes both these bugs. I hope it is correct. There are probably more side effects from the module split still to be discovered.
Paul Laufer diff -urN linux-devel-virgin/drivers/sound/dev_table.c linux/drivers/sound/dev_table.c --- linux-devel-virgin/drivers/sound/dev_table.c Mon Mar 13 12:29:00 2000 +++ linux/drivers/sound/dev_table.c Wed Mar 15 20:16:54 2000 @@ -210,6 +210,7 @@ { mixer_devs[dev] = NULL; unregister_sound_mixer(dev<<4); + num_mixers--; } } diff -urN linux-devel-virgin/drivers/sound/sb_common.c linux/drivers/sound/sb_common.c --- linux-devel-virgin/drivers/sound/sb_common.c Wed Mar 8 11:37:48 2000 +++ linux/drivers/sound/sb_common.c Wed Mar 15 20:16:54 2000 @@ -911,7 +911,7 @@ if (devc->irq > 0) free_irq(devc->irq, devc); - sound_unload_mixerdev(devc->my_mixerdev); + sb_mixer_unload(devc); /* We don't have to do this bit any more the UART401 is its own master -- Krzysztof Halasa */ /* But we have to do it, if UART401 is not detected */ diff -urN linux-devel-virgin/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c --- linux-devel-virgin/drivers/sound/sb_mixer.c Mon Feb 28 07:18:20 2000 +++ linux/drivers/sound/sb_mixer.c Wed Mar 15 20:16:54 2000 @@ -740,3 +740,9 @@ sb_mixer_reset(devc); return 1; } + +int sb_mixer_unload(sb_devc * devc) +{ + sound_unload_mixerdev(devc->my_mixerdev); + sbmixnum--; +} | |