diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_native.c | 9 | ||||
-rw-r--r-- | sound/oss/ac97_codec.c | 1 | ||||
-rw-r--r-- | sound/oss/au1550_ac97.c | 1 | ||||
-rw-r--r-- | sound/oss/awe_wave.c | 2 | ||||
-rw-r--r-- | sound/oss/cs4232.c | 6 | ||||
-rw-r--r-- | sound/oss/wavfront.c | 38 |
6 files changed, 36 insertions, 21 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 67abebabf83e..e97b2d162cc7 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2949,8 +2949,7 @@ static struct page * snd_pcm_mmap_status_nopage(struct vm_area_struct *area, uns return NOPAGE_OOM; runtime = substream->runtime; page = virt_to_page(runtime->status); - if (!PageReserved(page)) - get_page(page); + get_page(page); if (type) *type = VM_FAULT_MINOR; return page; @@ -2992,8 +2991,7 @@ static struct page * snd_pcm_mmap_control_nopage(struct vm_area_struct *area, un return NOPAGE_OOM; runtime = substream->runtime; page = virt_to_page(runtime->control); - if (!PageReserved(page)) - get_page(page); + get_page(page); if (type) *type = VM_FAULT_MINOR; return page; @@ -3066,8 +3064,7 @@ static struct page *snd_pcm_mmap_data_nopage(struct vm_area_struct *area, unsign vaddr = runtime->dma_area + offset; page = virt_to_page(vaddr); } - if (!PageReserved(page)) - get_page(page); + get_page(page); if (type) *type = VM_FAULT_MINOR; return page; diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c index 3ecef4689f1b..fd25aca25120 100644 --- a/sound/oss/ac97_codec.c +++ b/sound/oss/ac97_codec.c @@ -55,6 +55,7 @@ #include <linux/pci.h> #include <linux/ac97_codec.h> #include <asm/uaccess.h> +#include <asm/semaphore.h> #define CODEC_ID_BUFSZ 14 diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c index a78e48d412d2..6b46a8a4b1cc 100644 --- a/sound/oss/au1550_ac97.c +++ b/sound/oss/au1550_ac97.c @@ -35,7 +35,6 @@ #undef DEBUG -#include <linux/version.h> #include <linux/module.h> #include <linux/string.h> #include <linux/ioport.h> diff --git a/sound/oss/awe_wave.c b/sound/oss/awe_wave.c index d2b9beda8ace..b3ea719d33db 100644 --- a/sound/oss/awe_wave.c +++ b/sound/oss/awe_wave.c @@ -6062,7 +6062,7 @@ static int awe_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id io1 = pnp_port_start(dev,0); io2 = pnp_port_start(dev,1); io3 = pnp_port_start(dev,2); - printk(KERN_INFO "AWE32: A PnP Wave Table was detected at IO's %#x,%#x,%#x\n.", + printk(KERN_INFO "AWE32: A PnP Wave Table was detected at IO's %#x,%#x,%#x.\n", io1, io2, io3); setup_ports(io1, io2, io3); diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index 6ec308f5d935..7c59e2d4003a 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c @@ -195,10 +195,12 @@ static int __init probe_cs4232(struct address_info *hw_config, int isapnp_config CS_OUT2(0x15, 0x00); /* Select logical device 0 (WSS/SB/FM) */ CS_OUT3(0x47, (base >> 8) & 0xff, base & 0xff); /* WSS base */ - if (check_region(0x388, 4)) /* Not free */ + if (!request_region(0x388, 4, "FM")) /* Not free */ CS_OUT3(0x48, 0x00, 0x00) /* FM base off */ - else + else { + release_region(0x388, 4); CS_OUT3(0x48, 0x03, 0x88); /* FM base 0x388 */ + } CS_OUT3(0x42, 0x00, 0x00); /* SB base off */ CS_OUT2(0x22, irq); /* SB+WSS IRQ */ diff --git a/sound/oss/wavfront.c b/sound/oss/wavfront.c index b92ba8921638..b1a4eeb9dc08 100644 --- a/sound/oss/wavfront.c +++ b/sound/oss/wavfront.c @@ -2434,7 +2434,7 @@ static int __init detect_wavefront (int irq, int io_base) consumes 16. */ - if (check_region (io_base, 16)) { + if (!request_region (io_base, 16, "wavfront")) { printk (KERN_ERR LOGNAME "IO address range 0x%x - 0x%x " "already in use - ignored\n", dev.base, dev.base+15); @@ -2466,10 +2466,13 @@ static int __init detect_wavefront (int irq, int io_base) } else { printk (KERN_WARNING LOGNAME "not raw, but no " "hardware version!\n"); + release_region (io_base, 16); return 0; } if (!wf_raw) { + /* will re-acquire region in install_wavefront() */ + release_region (io_base, 16); return 1; } else { printk (KERN_INFO LOGNAME @@ -2489,6 +2492,7 @@ static int __init detect_wavefront (int irq, int io_base) if (wavefront_hw_reset ()) { printk (KERN_WARNING LOGNAME "hardware reset failed\n"); + release_region (io_base, 16); return 0; } @@ -2496,6 +2500,8 @@ static int __init detect_wavefront (int irq, int io_base) dev.has_fx = (detect_wffx () == 0); + /* will re-acquire region in install_wavefront() */ + release_region (io_base, 16); return 1; } @@ -2804,17 +2810,27 @@ static int __init wavefront_init (int atboot) } static int __init install_wavefront (void) - { + if (!request_region (dev.base+2, 6, "wavefront synth")) + return -1; + + if (dev.has_fx) { + if (!request_region (dev.base+8, 8, "wavefront fx")) { + release_region (dev.base+2, 6); + return -1; + } + } + if ((dev.synth_dev = register_sound_synth (&wavefront_fops, -1)) < 0) { printk (KERN_ERR LOGNAME "cannot register raw synth\n"); - return -1; + goto err_out; } #if OSS_SUPPORT_LEVEL & OSS_SUPPORT_SEQ if ((dev.oss_dev = sound_alloc_synthdev()) == -1) { printk (KERN_ERR LOGNAME "Too many sequencers\n"); - return -1; + /* FIXME: leak: should unregister sound synth */ + goto err_out; } else { synth_devs[dev.oss_dev] = &wavefront_operations; } @@ -2827,20 +2843,20 @@ static int __init install_wavefront (void) sound_unload_synthdev (dev.oss_dev); #endif /* OSS_SUPPORT_SEQ */ - return -1; + goto err_out; } - request_region (dev.base+2, 6, "wavefront synth"); - - if (dev.has_fx) { - request_region (dev.base+8, 8, "wavefront fx"); - } - if (wavefront_config_midi ()) { printk (KERN_WARNING LOGNAME "could not initialize MIDI.\n"); } return dev.oss_dev; + +err_out: + release_region (dev.base+2, 6); + if (dev.has_fx) + release_region (dev.base+8, 8); + return -1; } static void __exit uninstall_wavefront (void) |