dummy_del_mod_dep.c revision 354ebb48db8e66a853a58379a4808d5dcd1ceac3
1/* 2 * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. 3 * 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. 7 * 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. 11 * 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., 14 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 15 * 16 */ 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 *************************************************************************/ 23 24#ifndef MODULE 25#define MODULE 26#endif 27/* #define __KERNEL__ Commented this line out b/c it causes errors with 28 * module.h when it calls /usr/include/linux/version.h 29 * -11/22/02 Robbie Williamson <robbiew@us.ibm.com> 30 */ 31 32#include <asm/atomic.h> 33#include <linux/module.h> 34#include <linux/init.h> 35#include <linux/proc_fs.h> 36#include <linux/kernel.h> 37 38extern int dummy_func_test(void); 39 40static int __init dummy_init(void) 41{ 42 struct proc_dir_entry *proc_dummy; 43 44 proc_dummy = proc_mkdir("dummy_dep", 0); 45 dummy_func_test(); 46 return 0; 47} 48 49static void __exit dummy_exit(void) 50{ 51 remove_proc_entry("dummy_dep", 0); 52} 53 54module_init(dummy_init); 55module_exit(dummy_exit); 56