Use the race free function for adding a proc file.
[cascardo/kernel/samples/03.proc/.git] / hello_procfs.c
index a3ce21d..5e0e082 100644 (file)
@@ -53,15 +53,14 @@ static int hello_procfs_init(void)
        /* create the proc entry and set its fops: there is a potential race
         * here */
        struct proc_dir_entry *entry;
-       entry = create_proc_entry("gnu", 0666, NULL);
-       entry->proc_fops = &hello_procfs_fops;
+       entry = proc_create("hellop", 0666, NULL, &hello_procfs_fops);
        return 0;
 }
 
 static void hello_procfs_exit(void)
 {
        /* remove our proc entry */
-       remove_proc_entry("gnu", NULL);
+       remove_proc_entry("hellop", NULL);
 }
 
 module_init(hello_procfs_init);