patch-2.4.0-prerelease linux/net/ax25/ax25_dev.c

Next file: linux/net/ax25/ax25_ds_in.c
Previous file: linux/net/ax25/ax25_addr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test12/linux/net/ax25/ax25_dev.c linux/net/ax25/ax25_dev.c
@@ -17,7 +17,6 @@
  */
 
 #include <linux/config.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -39,8 +38,9 @@
 #include <linux/fcntl.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
 
-ax25_dev *ax25_dev_list = NULL;
+ax25_dev *ax25_dev_list;
 
 ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
 {
@@ -78,9 +78,7 @@
 		return;
 	}
 
-#ifdef CONFIG_SYSCTL
 	ax25_unregister_sysctl();
-#endif
 
 	memset(ax25_dev, 0x00, sizeof(*ax25_dev));
 
@@ -107,9 +105,7 @@
 	ax25_dev_list  = ax25_dev;
 	restore_flags(flags);
 
-#ifdef CONFIG_SYSCTL
 	ax25_register_sysctl();
-#endif
 }
 
 void ax25_dev_device_down(struct net_device *dev)
@@ -120,9 +116,7 @@
 	if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
 		return;
 
-#ifdef CONFIG_SYSCTL
 	ax25_unregister_sysctl();
-#endif
 
 	save_flags(flags); cli();
 
@@ -141,9 +135,7 @@
 		ax25_dev_list = s->next;
 		restore_flags(flags);
 		kfree(ax25_dev);
-#ifdef CONFIG_SYSCTL
 		ax25_register_sysctl();
-#endif
 		return;
 	}
 
@@ -152,9 +144,7 @@
 			s->next = ax25_dev->next;
 			restore_flags(flags);
 			kfree(ax25_dev);
-#ifdef CONFIG_SYSCTL
 			ax25_register_sysctl();
-#endif
 			return;
 		}
 
@@ -162,9 +152,7 @@
 	}
 
 	restore_flags(flags);
-#ifdef CONFIG_SYSCTL
 	ax25_register_sysctl();
-#endif
 }
 
 int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd)
@@ -209,12 +197,10 @@
 	return ax25_dev->forward;
 }
 
-#ifdef MODULE
-
 /*
  *	Free all memory associated with device structures.
  */
-void ax25_dev_free(void)
+void __exit ax25_dev_free(void)
 {
 	ax25_dev *s, *ax25_dev = ax25_dev_list;
 
@@ -225,7 +211,3 @@
 		kfree(s);
 	}
 }
-
-#endif
-
-#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)