Imported Upstream version 20080331
[ltp-debian.git] / testcases / kernel / module / delete_module / dummy_del_mod_dep.c
blob8d25509d80f2c3cdfc24201105dbc7c3ca373a2e
1 /*
2 * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * You should have received a copy of the GNU General Public License along
13 * with this program; if not, write the Free Software Foundation, Inc., 59
14 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 /*************************************************************************
18 * Description: This is a kernel loadable module programme used by
19 * delete_module03 testcase which inserts this module as part
20 * of setup. This module has dependency on dummy_del_mod module
21 * (calls function of dummy_del_mod during initialization).
22 *************************************************************************/
24 #define MODULE
25 /* #define __KERNEL__ Commented this line out b/c it causes errors with
26 * module.h when it calls /usr/include/linux/version.h
27 * -11/22/02 Robbie Williamson <robbiew@us.ibm.com>
30 #include <asm/atomic.h>
31 #include <linux/module.h>
32 #include <linux/init.h>
33 #include <linux/proc_fs.h>
34 #include <linux/kernel.h>
36 extern int dummy_func_test(void);
38 static int __init dummy_init(void) {
39 struct proc_dir_entry *proc_dummy;
41 proc_dummy = proc_mkdir("dummy_dep", 0);
42 dummy_func_test();
43 return 0;
46 static void __exit dummy_exit(void) {
47 remove_proc_entry("dummy_dep", 0);
50 module_init(dummy_init);
51 module_exit(dummy_exit);