]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/divert/divert_procfs.c
isdn: use non-racy method for proc entries creation
[linux-2.6-omap-h63xx.git] / drivers / isdn / divert / divert_procfs.c
index 559a0d0244cf38b59d6aa809bddee183089f8c44..8b256a617c8a4524cec9f503ef7371ebbf30356b 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #endif
 #include <linux/isdnif.h>
+#include <net/net_namespace.h>
 #include "isdn_divert.h"
 
 
@@ -284,16 +285,15 @@ divert_dev_init(void)
        init_waitqueue_head(&rd_queue);
 
 #ifdef CONFIG_PROC_FS
-       isdn_proc_entry = proc_mkdir("net/isdn", NULL);
+       isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net);
        if (!isdn_proc_entry)
                return (-1);
-       isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry);
+       isdn_divert_entry = proc_create("divert", S_IFREG | S_IRUGO,
+                                       isdn_proc_entry, &isdn_fops);
        if (!isdn_divert_entry) {
-               remove_proc_entry("net/isdn", NULL);
+               remove_proc_entry("isdn", init_net.proc_net);
                return (-1);
        }
-       isdn_divert_entry->proc_fops = &isdn_fops; 
-       isdn_divert_entry->owner = THIS_MODULE; 
 #endif /* CONFIG_PROC_FS */
 
        return (0);
@@ -309,7 +309,7 @@ divert_dev_deinit(void)
 
 #ifdef CONFIG_PROC_FS
        remove_proc_entry("divert", isdn_proc_entry);
-       remove_proc_entry("net/isdn", NULL);
+       remove_proc_entry("isdn", init_net.proc_net);
 #endif /* CONFIG_PROC_FS */
 
        return (0);