patch-2.4.4 linux/fs/devpts/inode.c

Next file: linux/fs/efs/super.c
Previous file: linux/fs/devfs/base.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/fs/devpts/inode.c linux/fs/devpts/inode.c
@@ -220,7 +220,7 @@
 	}
 }
 
-int __init init_devpts_fs(void)
+static int __init init_devpts_fs(void)
 {
 	int err = register_filesystem(&devpts_fs_type);
 	if (!err) {
@@ -228,28 +228,25 @@
 		err = PTR_ERR(devpts_mnt);
 		if (!IS_ERR(devpts_mnt))
 			err = 0;
-	}
-	return err;
-}
-
 #ifdef MODULE
-
-int init_module(void)
-{
-	int err = init_devpts_fs();
-	if ( !err ) {
-		devpts_upcall_new  = devpts_pty_new;
-		devpts_upcall_kill = devpts_pty_kill;
+		if ( !err ) {
+			devpts_upcall_new  = devpts_pty_new;
+			devpts_upcall_kill = devpts_pty_kill;
+		}
+#endif
 	}
 	return err;
 }
 
-void cleanup_module(void)
+static void __exit exit_devpts_fs(void)
 {
+#ifdef MODULE
 	devpts_upcall_new  = NULL;
 	devpts_upcall_kill = NULL;
+#endif
 	unregister_filesystem(&devpts_fs_type);
 	kern_umount(devpts_mnt);
 }
 
-#endif
+module_init(init_devpts_fs)
+module_exit(exit_devpts_fs)

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