diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-09 23:29:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-09 23:29:35 +0000 |
commit | 35385d7a83b4cae6d5ea5f80f3b3377d94178344 (patch) | |
tree | 49494d95dfef31ba4f9a697d31e4028cf65a57bd /drivers/isdn | |
parent | d9d8062e7b49943b2a2fb034f817a9fc217fd40f (diff) |
Merge with 2.4.0-test3-pre7.
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/divert/divert_procfs.c | 6 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_procconf.c | 15 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_procfs.c | 15 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_proclog.c | 13 |
4 files changed, 29 insertions, 20 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index f8e7b418c..f7d7ee8d5 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/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 @@ isdn_divert_open(struct inode *ino, struct file *filep) { int flags; - MOD_INC_USE_COUNT; + lock_kernel(); save_flags(flags); cli(); if_used++; @@ -185,6 +186,7 @@ isdn_divert_open(struct inode *ino, struct file *filep) (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 @@ isdn_divert_close(struct inode *ino, struct file *filep) divert_info_head = divert_info_head->next; kfree(inf); } - MOD_DEC_USE_COUNT; return (0); } /* isdn_divert_close */ @@ -345,6 +346,7 @@ divert_dev_init(void) return (-1); } isdn_divert_entry->proc_fops = &isdn_fops; + isdn_divert_entry->owner = THIS_MODULE; #endif /* CONFIG_PROC_FS */ return (0); diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index ac67610f7..c27c926a1 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c @@ -45,6 +45,7 @@ #include <linux/poll.h> #include <linux/proc_fs.h> #include <linux/pci.h> +#include <linux/smp_lock.h> #include "hysdn_defs.h" @@ -286,9 +287,8 @@ hysdn_conf_open(struct inode *ino, struct file *filep) struct conf_writedata *cnf; char *cp, *tmp; - MOD_INC_USE_COUNT; /* lock module */ - /* now search the addressed card */ + lock_kernel(); card = card_root; while (card) { pd = card->procconf; @@ -297,7 +297,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep) card = card->next; /* search next entry */ } if (!card) { - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-ENODEV); /* device is unknown/invalid */ } if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL)) @@ -308,7 +308,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep) /* write only access -> write boot file or conf line */ if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) { - MOD_DEC_USE_COUNT; + unlock_kernel(); return (-EFAULT); } cnf->card = card; @@ -320,7 +320,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep) /* read access -> output card info data */ if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) { - MOD_DEC_USE_COUNT; + unlock_kernel(); return (-EFAULT); /* out of memory */ } filep->private_data = tmp; /* start of string */ @@ -354,9 +354,10 @@ hysdn_conf_open(struct inode *ino, struct file *filep) *cp++ = '\n'; *cp = 0; /* end of string */ } else { /* simultaneous read/write access forbidden ! */ - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-EPERM); /* no permission this time */ } + unlock_kernel(); return (0); } /* hysdn_conf_open */ @@ -402,7 +403,6 @@ hysdn_conf_close(struct inode *ino, struct file *filep) if (filep->private_data) kfree(filep->private_data); /* release memory */ } - MOD_DEC_USE_COUNT; /* reduce usage count */ return (retval); } /* hysdn_conf_close */ @@ -447,6 +447,7 @@ hysdn_procconf_init(void) S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops; + ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE; hysdn_proclog_init(card); /* init the log file entry */ } card = card->next; /* next entry */ diff --git a/drivers/isdn/hysdn/hysdn_procfs.c b/drivers/isdn/hysdn/hysdn_procfs.c index 867b22766..ae07f6597 100644 --- a/drivers/isdn/hysdn/hysdn_procfs.c +++ b/drivers/isdn/hysdn/hysdn_procfs.c @@ -33,6 +33,7 @@ #include <linux/poll.h> #include <linux/proc_fs.h> #include <linux/pci.h> +#include <linux/smp_lock.h> #include "hysdn_defs.h" @@ -198,7 +199,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) struct procdata *pd; ulong flags; - MOD_INC_USE_COUNT; /* lock module */ + lock_kernel(); card = card_root; while (card) { pd = card->procfs; @@ -207,7 +208,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) card = card->next; /* search next entry */ } if (!card) { - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-ENODEV); /* device is unknown/invalid */ } filep->private_data = card; /* remember our own card */ @@ -215,7 +216,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) { /* write only access -> boot pof data */ if (pof_boot_open(card)) { - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-EPERM); /* no permission this time */ } } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) { @@ -231,9 +232,10 @@ hysdn_log_open(struct inode *ino, struct file *filep) restore_flags(flags); } else { /* simultaneous read/write access forbidden ! */ - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-EPERM); /* no permission this time */ } + unlock_kernel(); return (0); } /* hysdn_log_open */ @@ -295,7 +297,6 @@ hysdn_log_close(struct inode *ino, struct file *filep) } } /* read access */ - MOD_DEC_USE_COUNT; return (retval); } /* hysdn_log_close */ @@ -437,8 +438,10 @@ hysdn_procfs_init(void) memset(pd, 0, sizeof(struct procdata)); sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid); - if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) + if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { pd->log->proc_fops = &log_fops; /* set new operations table */ + pd->log->owner = THIS_MODULE; + } init_waitqueue_head(&(pd->rd_queue)); diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index d93b59995..1a2980f02 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -45,6 +45,7 @@ #include <linux/poll.h> #include <linux/proc_fs.h> #include <linux/pci.h> +#include <linux/smp_lock.h> #include "hysdn_defs.h" @@ -293,7 +294,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) struct procdata *pd; ulong flags; - MOD_INC_USE_COUNT; /* lock module */ + lock_kernel(); card = card_root; while (card) { pd = card->proclog; @@ -302,7 +303,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) card = card->next; /* search next entry */ } if (!card) { - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-ENODEV); /* device is unknown/invalid */ } filep->private_data = card; /* remember our own card */ @@ -321,9 +322,10 @@ hysdn_log_open(struct inode *ino, struct file *filep) (struct log_data **) filep->private_data = &(pd->log_head); restore_flags(flags); } else { /* simultaneous read/write access forbidden ! */ - MOD_DEC_USE_COUNT; /* unlock module */ + unlock_kernel(); return (-EPERM); /* no permission this time */ } + unlock_kernel(); return (0); } /* hysdn_log_open */ @@ -385,7 +387,6 @@ hysdn_log_close(struct inode *ino, struct file *filep) } } /* read access */ - MOD_DEC_USE_COUNT; return (retval); } /* hysdn_log_close */ @@ -451,8 +452,10 @@ hysdn_proclog_init(hysdn_card * card) if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) { memset(pd, 0, sizeof(struct procdata)); sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid); - if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) + if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) { pd->log->proc_fops = &log_fops; + pd->log->owner = THIS_MODULE; + } init_waitqueue_head(&(pd->rd_queue)); |