Commit 104c7aaa authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[IPV4/IPV6]: Convert tunnel drivers to unconditional module_init.

parent 22a4bcc2
......@@ -37,10 +37,4 @@ struct ipv6_tlv_tnl_enc_lim {
__u8 encap_limit; /* tunnel encapsulation limit */
} __attribute__ ((packed));
#ifdef __KERNEL__
#ifdef CONFIG_IPV6_TUNNEL
extern int __init ip6_tunnel_init(void);
extern void ip6_tunnel_cleanup(void);
#endif
#endif
#endif
......@@ -45,8 +45,6 @@ struct ip_tunnel
} while (0)
extern int ipip_init(void);
extern int ipgre_init(void);
extern int sit_init(void);
extern void sit_cleanup(void);
......
......@@ -1167,16 +1167,6 @@ static int __init inet_init(void)
icmp_init(&inet_family_ops);
/* I wish inet_add_protocol had no constructor hook...
I had to move IPIP from net/ipv4/protocol.c :-( --ANK
*/
#ifdef CONFIG_NET_IPIP
ipip_init();
#endif
#ifdef CONFIG_NET_IPGRE
ipgre_init();
#endif
/*
* Initialise the multicast router
*/
......
......@@ -1250,7 +1250,7 @@ static struct inet_protocol ipgre_protocol = {
* And now the modules code and kernel interface.
*/
int __init ipgre_init(void)
static int __init ipgre_init(void)
{
int err = -EINVAL;
......@@ -1288,8 +1288,6 @@ void ipgre_fini(void)
unregister_netdev(ipgre_fb_tunnel_dev);
}
#ifdef MODULE
module_init(ipgre_init);
#endif
module_exit(ipgre_fini);
MODULE_LICENSE("GPL");
......@@ -872,7 +872,7 @@ static struct xfrm_tunnel ipip_handler = {
static char banner[] __initdata =
KERN_INFO "IPv4 over IPv4 tunneling driver\n";
int __init ipip_init(void)
static int __init ipip_init(void)
{
int err;
......@@ -911,8 +911,6 @@ static void __exit ipip_fini(void)
unregister_netdev(ipip_fb_tunnel_dev);
}
#ifdef MODULE
module_init(ipip_init);
#endif
module_exit(ipip_fini);
MODULE_LICENSE("GPL");
......@@ -788,11 +788,6 @@ static int __init inet6_init(void)
err = ndisc_init(&inet6_family_ops);
if (err)
goto ndisc_fail;
#ifdef CONFIG_IPV6_TUNNEL
err = ip6_tunnel_init();
if (err)
goto ip6_tunnel_fail;
#endif
err = igmp6_init(&inet6_family_ops);
if (err)
goto igmp_fail;
......@@ -846,9 +841,6 @@ static int __init inet6_init(void)
igmp6_cleanup();
#endif
igmp_fail:
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
ip6_tunnel_fail:
#endif
ndisc_cleanup();
ndisc_fail:
......@@ -882,9 +874,6 @@ static void __exit inet6_exit(void)
ip6_route_cleanup();
ipv6_packet_cleanup();
igmp6_cleanup();
#ifdef CONFIG_IPV6_TUNNEL
ip6_tunnel_cleanup();
#endif
ndisc_cleanup();
icmpv6_cleanup();
#ifdef CONFIG_SYSCTL
......
......@@ -1100,7 +1100,7 @@ static struct inet6_protocol ip6ip6_protocol = {
* Return: 0 on success
**/
int __init ip6_tunnel_init(void)
static int __init ip6_tunnel_init(void)
{
int err;
......@@ -1131,13 +1131,11 @@ int __init ip6_tunnel_init(void)
* ip6_tunnel_cleanup - free resources and unregister protocol
**/
void ip6_tunnel_cleanup(void)
static void __exit ip6_tunnel_cleanup(void)
{
unregister_netdev(ip6ip6_fb_tnl_dev);
inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6);
}
#ifdef MODULE
module_init(ip6_tunnel_init);
module_exit(ip6_tunnel_cleanup);
#endif
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