Commit 7c81ce02 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

[NET]: Switch comx over to initcalls.

parent ad5f4823
......@@ -16,7 +16,6 @@ extern int scc_enet_init(void);
extern int fec_enet_init(void);
extern int sdla_setup(void);
extern int sdla_c_setup(void);
extern int comx_init(void);
extern int lmc_setup(void);
extern int madgemc_probe(void);
......@@ -52,10 +51,6 @@ static struct net_probe pci_probes[] __initdata = {
#if defined(CONFIG_FEC_ENET)
{fec_enet_init, 0},
#endif
#if defined(CONFIG_COMX)
{comx_init, 0},
#endif
#if defined(CONFIG_LANMEDIA)
{lmc_setup, 0},
#endif
......
......@@ -1427,24 +1427,20 @@ static struct comx_hardware hicomx_hw = {
NULL
};
#ifdef MODULE
#define comx_hw_comx_init init_module
#endif
int __init comx_hw_comx_init(void)
static int __init comx_hw_comx_init(void)
{
comx_register_hardware(&comx_hw);
comx_register_hardware(&cmx_hw);
comx_register_hardware(&hicomx_hw);
memset(memory_used, 0, sizeof(memory_used));
return 0;
}
#ifdef MODULE
void cleanup_module(void)
static void __exit comx_hw_comx_exit(void)
{
comx_unregister_hardware("comx");
comx_unregister_hardware("cmx");
comx_unregister_hardware("hicomx");
}
#endif
module_init(comx_hw_comx_init);
module_exit(comx_hw_comx_exit);
......@@ -479,20 +479,16 @@ static struct comx_hardware locomx_hw = {
NULL
};
#ifdef MODULE
#define comx_hw_locomx_init init_module
#endif
int __init comx_hw_locomx_init(void)
static int __init comx_hw_locomx_init(void)
{
comx_register_hardware(&locomx_hw);
return 0;
}
#ifdef MODULE
void cleanup_module(void)
static void __exit comx_hw_locomx_exit(void)
{
comx_unregister_hardware("locomx");
return;
}
#endif
module_init(comx_hw_locomx_init);
module_exit(comx_hw_locomx_exit);
......@@ -944,21 +944,15 @@ static struct comx_hardware mixcomhw = {
NULL
};
/* Module management */
#ifdef MODULE
#define comx_hw_mixcom_init init_module
#endif
int __init comx_hw_mixcom_init(void)
static int __init comx_hw_mixcom_init(void)
{
return(comx_register_hardware(&mixcomhw));
return comx_register_hardware(&mixcomhw);
}
#ifdef MODULE
void
cleanup_module(void)
static void __exit comx_hw_mixcom_exit(void)
{
comx_unregister_hardware("mixcom");
}
#endif
module_init(comx_hw_mixcom_init);
module_exit(comx_hw_mixcom_exit);
......@@ -988,11 +988,7 @@ static struct comx_hardware fr_dlci = {
.hw_dump = dlci_dump,
};
#ifdef MODULE
#define comx_proto_fr_init init_module
#endif
int __init comx_proto_fr_init(void)
static int __init comx_proto_fr_init(void)
{
int ret;
......@@ -1005,12 +1001,12 @@ int __init comx_proto_fr_init(void)
return comx_register_protocol(&fr_slave_protocol);
}
#ifdef MODULE
void cleanup_module(void)
static void __exit comx_proto_fr_exit(void)
{
comx_unregister_hardware(fr_dlci.name);
comx_unregister_protocol(fr_master_protocol.name);
comx_unregister_protocol(fr_slave_protocol.name);
}
#endif /* MODULE */
module_init(comx_proto_fr_init);
module_exit(comx_proto_fr_exit);
......@@ -523,7 +523,7 @@ static struct comx_protocol comx25_protocol = {
NULL
};
int __init comx_proto_lapb_init(void)
static int __init comx_proto_lapb_init(void)
{
int ret;
......@@ -539,9 +539,7 @@ static void __exit comx_proto_lapb_exit(void)
comx_unregister_protocol(comx25_protocol.name);
}
#ifdef MODULE
module_init(comx_proto_lapb_init);
#endif
module_exit(comx_proto_lapb_exit);
MODULE_LICENSE("GPL");
......@@ -247,26 +247,24 @@ static struct comx_protocol hdlc_protocol = {
NULL
};
#ifdef MODULE
#define comx_proto_ppp_init init_module
#endif
int __init comx_proto_ppp_init(void)
static int __init comx_proto_ppp_init(void)
{
int ret;
if(0!=(ret=comx_register_protocol(&hdlc_protocol))) {
return ret;
ret = comx_register_protocol(&hdlc_protocol);
if (!ret) {
ret = comx_register_protocol(&syncppp_protocol);
if (ret)
comx_unregister_protocol(hdlc_protocol.name);
}
return comx_register_protocol(&syncppp_protocol);
return ret;
}
#ifdef MODULE
void cleanup_module(void)
static void __exit comx_proto_ppp_exit(void)
{
comx_unregister_protocol(syncppp_protocol.name);
comx_unregister_protocol(hdlc_protocol.name);
}
#endif /* MODULE */
module_init(comx_proto_ppp_init);
module_exit(comx_proto_ppp_exit);
......@@ -81,15 +81,6 @@ MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
MODULE_DESCRIPTION("Common code for the COMX synchronous serial adapters");
MODULE_LICENSE("GPL");
extern int comx_hw_comx_init(void);
extern int comx_hw_locomx_init(void);
extern int comx_hw_mixcom_init(void);
extern int comx_proto_hdlc_init(void);
extern int comx_proto_ppp_init(void);
extern int comx_proto_syncppp_init(void);
extern int comx_proto_lapb_init(void);
extern int comx_proto_fr_init(void);
static struct comx_hardware *comx_channels = NULL;
static struct comx_protocol *comx_lines = NULL;
......@@ -1078,11 +1069,7 @@ int comx_unregister_protocol(char *name)
return -1;
}
#ifdef MODULE
#define comx_init init_module
#endif
int __init comx_init(void)
static int __init comx_init(void)
{
struct proc_dir_entry *new_file;
......@@ -1115,42 +1102,18 @@ int __init comx_init(void)
printk(KERN_INFO "COMX: driver version %s (C) 1995-1999 ITConsult-Pro Co. <info@itc.hu>\n",
VERSION);
#ifndef MODULE
#ifdef CONFIG_COMX_HW_COMX
comx_hw_comx_init();
#endif
#ifdef CONFIG_COMX_HW_LOCOMX
comx_hw_locomx_init();
#endif
#ifdef CONFIG_COMX_HW_MIXCOM
comx_hw_mixcom_init();
#endif
#ifdef CONFIG_COMX_PROTO_HDLC
comx_proto_hdlc_init();
#endif
#ifdef CONFIG_COMX_PROTO_PPP
comx_proto_ppp_init();
#endif
#ifdef CONFIG_COMX_PROTO_LAPB
comx_proto_lapb_init();
#endif
#ifdef CONFIG_COMX_PROTO_FR
comx_proto_fr_init();
#endif
#endif
return 0;
}
#ifdef MODULE
void cleanup_module(void)
static void __exit comx_exit(void)
{
remove_proc_entry(FILENAME_HARDWARELIST, comx_root_dir);
remove_proc_entry(FILENAME_PROTOCOLLIST, comx_root_dir);
remove_proc_entry(comx_root_dir->name, &proc_root);
}
#endif
module_init(comx_init);
module_exit(comx_exit);
EXPORT_SYMBOL(comx_register_hardware);
EXPORT_SYMBOL(comx_unregister_hardware);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment