Home | History | Annotate | Download | only in delete_module
      1 // SPDX-License-Identifier: GPL-2.0-or-later
      2 /*
      3  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
      4  * Copyright (c) 2018 Xiao Yang <yangx.jy (at) cn.fujitsu.com>
      5  */
      6 /*
      7  * Description:
      8  * This is a kernel loadable module programme used by delete_module*
      9  * testcases which insert this module as part setup.
     10  */
     11 
     12 #include <linux/module.h>
     13 #include <linux/init.h>
     14 #include <linux/proc_fs.h>
     15 #include <linux/kernel.h>
     16 
     17 static int dummy_func_test(void);
     18 
     19 /* Dummy function called by dependent module */
     20 int dummy_func_test(void)
     21 {
     22 	return 0;
     23 }
     24 EXPORT_SYMBOL(dummy_func_test);
     25 
     26 static int __init dummy_init(void)
     27 {
     28 	struct proc_dir_entry *proc_dummy;
     29 
     30 	proc_dummy = proc_mkdir("dummy", 0);
     31 	return 0;
     32 }
     33 
     34 static void __exit dummy_exit(void)
     35 {
     36 	remove_proc_entry("dummy", 0);
     37 }
     38 
     39 module_init(dummy_init);
     40 module_exit(dummy_exit);
     41 MODULE_LICENSE("GPL");
     42