vserver 1.9.5.x5
[linux-2.6.git] / sound / oss / sb_card.c
index 012f6d2..de3fd49 100644 (file)
@@ -52,7 +52,7 @@ static int __initdata esstype   = 0; /* ESS chip type */
 static int __initdata acer     = 0; /* Do acer notebook init? */
 static int __initdata sm_games         = 0; /* Logitech soundman games? */
 
-struct sb_card_config *legacy = NULL;
+static struct sb_card_config *legacy = NULL;
 
 #ifdef CONFIG_PNP
 static int __initdata pnp       = 1;
@@ -100,7 +100,14 @@ MODULE_PARM_DESC(uart401,  "When set to 1, will attempt to detect and enable"\
 /* OSS subsystem card registration shared by PnP and legacy routines */
 static int sb_register_oss(struct sb_card_config *scc, struct sb_module_options *sbmo)
 {
-       if(!sb_dsp_detect(&scc->conf, 0, 0, sbmo)) {
+       if (!request_region(scc->conf.io_base, 16, "soundblaster")) {
+               printk(KERN_ERR "sb: ports busy.\n");
+               kfree(scc);
+               return -EBUSY;
+       }
+
+       if (!sb_dsp_detect(&scc->conf, 0, 0, sbmo)) {
+               release_region(scc->conf.io_base, 16);
                printk(KERN_ERR "sb: Failed DSP Detect.\n");
                kfree(scc);
                return -ENODEV;