diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
commit | ae38fd1e4c98588314a42097c5a5e77dcef23561 (patch) | |
tree | f9f10c203bb9e5fbad4810d1f8774c08dfad20ff /drivers/sound/adlib_card.c | |
parent | 466a823d79f41d0713b272e48fd73e494b0588e0 (diff) |
Merge with Linux 2.3.50.
Diffstat (limited to 'drivers/sound/adlib_card.c')
-rw-r--r-- | drivers/sound/adlib_card.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/drivers/sound/adlib_card.c b/drivers/sound/adlib_card.c index 087c57b68..95974d444 100644 --- a/drivers/sound/adlib_card.c +++ b/drivers/sound/adlib_card.c @@ -11,47 +11,42 @@ */ #include <linux/module.h> +#include <linux/init.h> + #include "sound_config.h" #include "soundmodule.h" -void attach_adlib_card(struct address_info *hw_config) +#include "opl3.h" + +static void __init attach_adlib_card(struct address_info *hw_config) { hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp); request_region(hw_config->io_base, 4, "OPL3/OPL2"); } -int probe_adlib(struct address_info *hw_config) +static int __init probe_adlib(struct address_info *hw_config) { - if (check_region(hw_config->io_base, 4)) - { + if (check_region(hw_config->io_base, 4)) { DDB(printk("opl3.c: I/O port %x already in use\n", hw_config->io_base)); return 0; } return opl3_detect(hw_config->io_base, hw_config->osp); } -void unload_adlib(struct address_info *hw_config) -{ - release_region(hw_config->io_base, 4); - sound_unload_synthdev(hw_config->slots[0]); -} +static struct address_info cfg; -#ifdef MODULE +static int __initdata io = -1; -int io = -1; MODULE_PARM(io, "i"); -EXPORT_NO_SYMBOLS; - -struct address_info cfg; - -int init_module(void) +static int __init init_adlib(void) { - if (io == -1) { + cfg.io_base = io; + + if (cfg.io_base == -1) { printk(KERN_ERR "adlib: must specify I/O address.\n"); return -EINVAL; } - cfg.io_base = io; if (probe_adlib(&cfg) == 0) return -ENODEV; attach_adlib_card(&cfg); @@ -59,10 +54,27 @@ int init_module(void) return 0; } -void cleanup_module(void) +static void __exit cleanup_adlib(void) { - unload_adlib(&cfg); + release_region(cfg.io_base, 4); + sound_unload_synthdev(cfg.slots[0]); + SOUND_LOCK_END; } -#endif /* MODULE */ +module_init(init_adlib); +module_exit(cleanup_adlib); + +#ifndef MODULE +static int __init setup_adlib(char *str) +{ + /* io */ + int ints[2]; + str = get_options(str, ARRAY_SIZE(ints), ints); + + io = ints[1]; + + return 1; +} +__setup("adlib=", setup_adlib); +#endif |