patch-2.4.0-test3 linux/drivers/isdn/divert/divert_procfs.c

Next file: linux/drivers/isdn/hysdn/hysdn_procconf.c
Previous file: linux/drivers/isdn/avmb1/t1pci.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/isdn/divert/divert_procfs.c linux/drivers/isdn/divert/divert_procfs.c
@@ -55,6 +55,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/poll.h>
+#include <linux/smp_lock.h>
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
 #else
@@ -175,7 +176,7 @@
 {
 	int flags;
 
-	MOD_INC_USE_COUNT;
+	lock_kernel();
 	save_flags(flags);
 	cli();
 	if_used++;
@@ -185,6 +186,7 @@
 		(struct divert_info **) filep->private_data = &divert_info_head;
 	restore_flags(flags);
 	/*  start_divert(); */
+	unlock_kernel();
 	return (0);
 }				/* isdn_divert_open */
 
@@ -212,7 +214,6 @@
 			divert_info_head = divert_info_head->next;
 			kfree(inf);
 		}
-	MOD_DEC_USE_COUNT;
 	return (0);
 }				/* isdn_divert_close */
 
@@ -345,6 +346,7 @@
 		return (-1);
 	}
 	isdn_divert_entry->proc_fops = &isdn_fops; 
+	isdn_divert_entry->owner = THIS_MODULE; 
 #endif	/* CONFIG_PROC_FS */
 
 	return (0);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)