[PATCH] fix semaphore handling in __unregister_chrdev_region
[linux/fpc-iii.git] / sound / oss / adlib_card.c
blob6414ceb8f0724c0ccb200d10cb61aa5ab983376b
1 /*
2 * sound/adlib_card.c
4 * Detection routine for the AdLib card.
6 * Copyright (C) by Hannu Savolainen 1993-1997
8 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
9 * Version 2 (June 1991). See the "COPYING" file distributed with this software
10 * for more info.
13 #include <linux/module.h>
14 #include <linux/init.h>
16 #include "sound_config.h"
18 #include "opl3.h"
20 static void __init attach_adlib_card(struct address_info *hw_config)
22 hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp, THIS_MODULE);
25 static int __init probe_adlib(struct address_info *hw_config)
27 return opl3_detect(hw_config->io_base, hw_config->osp);
30 static struct address_info cfg;
32 static int __initdata io = -1;
34 module_param(io, int, 0);
36 static int __init init_adlib(void)
38 cfg.io_base = io;
40 if (cfg.io_base == -1) {
41 printk(KERN_ERR "adlib: must specify I/O address.\n");
42 return -EINVAL;
44 if (probe_adlib(&cfg) == 0)
45 return -ENODEV;
46 attach_adlib_card(&cfg);
48 return 0;
51 static void __exit cleanup_adlib(void)
53 sound_unload_synthdev(cfg.slots[0]);
57 module_init(init_adlib);
58 module_exit(cleanup_adlib);
60 #ifndef MODULE
61 static int __init setup_adlib(char *str)
63 /* io */
64 int ints[2];
65 str = get_options(str, ARRAY_SIZE(ints), ints);
67 io = ints[1];
69 return 1;
71 __setup("adlib=", setup_adlib);
72 #endif
73 MODULE_LICENSE("GPL");