Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203480
b: refs/heads/master
c: 76a6492
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and David S. Miller committed Jul 13, 2010
1 parent 83ed5fb commit 1fb2366
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d361fd599a991ff6c1d522a599c635b35d61ef30
refs/heads/master: 76a64921dad9acd76270dc74249f0dfe11c84bb8
6 changes: 3 additions & 3 deletions trunk/drivers/isdn/capi/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/signal.h>
#include <linux/mutex.h>
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/tty.h>
Expand Down Expand Up @@ -50,6 +49,7 @@ MODULE_LICENSE("GPL");

/* -------- driver information -------------------------------------- */

static DEFINE_MUTEX(capi_mutex);
static struct class *capi_class;
static int capi_major = 68; /* allocated */

Expand Down Expand Up @@ -985,9 +985,9 @@ capi_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
mutex_lock(&capi_mutex);
ret = capi_ioctl(file, cmd, arg);
unlock_kernel();
mutex_unlock(&capi_mutex);

return ret;
}
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/isdn/divert/divert_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
#include <linux/sched.h>
#include <linux/isdnif.h>
#include <net/net_namespace.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include "isdn_divert.h"


/*********************************/
/* Variables for interface queue */
/*********************************/
ulong if_used = 0; /* number of interface users */
static DEFINE_MUTEX(isdn_divert_mutex);
static struct divert_info *divert_info_head = NULL; /* head of queue */
static struct divert_info *divert_info_tail = NULL; /* pointer to last entry */
static DEFINE_SPINLOCK(divert_info_lock);/* lock for queue */
Expand Down Expand Up @@ -261,9 +262,9 @@ static long isdn_divert_ioctl(struct file *file, uint cmd, ulong arg)
{
long ret;

lock_kernel();
mutex_lock(&isdn_divert_mutex);
ret = isdn_divert_ioctl_unlocked(file, cmd, arg);
unlock_kernel();
mutex_unlock(&isdn_divert_mutex);

return ret;
}
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/isdn/hardware/eicon/divamnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/poll.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>

#include "platform.h"
#include "di_defs.h"
#include "divasync.h"
#include "debug_if.h"

static DEFINE_MUTEX(maint_mutex);
static char *main_revision = "$Revision: 1.32.6.10 $";

static int major;
Expand Down Expand Up @@ -130,7 +131,7 @@ static int maint_open(struct inode *ino, struct file *filep)
{
int ret;

lock_kernel();
mutex_lock(&maint_mutex);
/* only one open is allowed, so we test
it atomically */
if (test_and_set_bit(0, &opened))
Expand All @@ -139,7 +140,7 @@ static int maint_open(struct inode *ino, struct file *filep)
filep->private_data = NULL;
ret = nonseekable_open(ino, filep);
}
unlock_kernel();
mutex_unlock(&maint_mutex);
return ret;
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/isdn/hardware/eicon/divasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>

#include "platform.h"
Expand Down Expand Up @@ -402,7 +401,6 @@ static unsigned int um_idi_poll(struct file *file, poll_table * wait)

static int um_idi_open(struct inode *inode, struct file *file)
{
cycle_kernel_lock();
return (0);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/isdn/hardware/eicon/divasmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/list.h>
#include <linux/poll.h>
#include <linux/kmod.h>
#include <linux/smp_lock.h>

#include "platform.h"
#undef ID_MASK
Expand Down Expand Up @@ -581,7 +580,6 @@ xdi_copy_from_user(void *os_handle, void *dst, const void __user *src, int lengt
*/
static int divas_open(struct inode *inode, struct file *file)
{
cycle_kernel_lock();
return (0);
}

Expand Down
21 changes: 11 additions & 10 deletions trunk/drivers/isdn/hysdn/hysdn_procconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
#include <linux/proc_fs.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <net/net_namespace.h>

#include "hysdn_defs.h"

static DEFINE_MUTEX(hysdn_conf_mutex);
static char *hysdn_procconf_revision = "$Revision: 1.8.6.4 $";

#define INFO_OUT_LEN 80 /* length of info line including lf */
Expand Down Expand Up @@ -234,7 +235,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
char *cp, *tmp;

/* now search the addressed card */
lock_kernel();
mutex_lock(&hysdn_conf_mutex);
card = card_root;
while (card) {
pd = card->procconf;
Expand All @@ -243,7 +244,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
card = card->next; /* search next entry */
}
if (!card) {
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (-ENODEV); /* device is unknown/invalid */
}
if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
Expand All @@ -255,7 +256,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))) {
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (-EFAULT);
}
cnf->card = card;
Expand All @@ -267,7 +268,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
/* read access -> output card info data */

if (!(tmp = kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (-EFAULT); /* out of memory */
}
filep->private_data = tmp; /* start of string */
Expand Down Expand Up @@ -301,10 +302,10 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
*cp++ = '\n';
*cp = 0; /* end of string */
} else { /* simultaneous read/write access forbidden ! */
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (-EPERM); /* no permission this time */
}
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return nonseekable_open(ino, filep);
} /* hysdn_conf_open */

Expand All @@ -319,7 +320,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
int retval = 0;
struct proc_dir_entry *pd;

lock_kernel();
mutex_lock(&hysdn_conf_mutex);
/* search the addressed card */
card = card_root;
while (card) {
Expand All @@ -329,7 +330,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
card = card->next; /* search next entry */
}
if (!card) {
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (-ENODEV); /* device is unknown/invalid */
}
if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
Expand All @@ -352,7 +353,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)

kfree(filep->private_data); /* release memory */
}
unlock_kernel();
mutex_unlock(&hysdn_conf_mutex);
return (retval);
} /* hysdn_conf_close */

Expand Down
15 changes: 8 additions & 7 deletions trunk/drivers/isdn/hysdn/hysdn_proclog.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
#include <linux/proc_fs.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>

#include "hysdn_defs.h"

/* the proc subdir for the interface is defined in the procconf module */
extern struct proc_dir_entry *hysdn_proc_entry;

static DEFINE_MUTEX(hysdn_log_mutex);
static void put_log_buffer(hysdn_card * card, char *cp);

/*************************************************/
Expand Down Expand Up @@ -251,7 +252,7 @@ hysdn_log_open(struct inode *ino, struct file *filep)
struct procdata *pd = NULL;
unsigned long flags;

lock_kernel();
mutex_lock(&hysdn_log_mutex);
card = card_root;
while (card) {
pd = card->proclog;
Expand All @@ -260,7 +261,7 @@ hysdn_log_open(struct inode *ino, struct file *filep)
card = card->next; /* search next entry */
}
if (!card) {
unlock_kernel();
mutex_unlock(&hysdn_log_mutex);
return (-ENODEV); /* device is unknown/invalid */
}
filep->private_data = card; /* remember our own card */
Expand All @@ -278,10 +279,10 @@ hysdn_log_open(struct inode *ino, struct file *filep)
filep->private_data = &pd->log_head;
spin_unlock_irqrestore(&card->hysdn_lock, flags);
} else { /* simultaneous read/write access forbidden ! */
unlock_kernel();
mutex_unlock(&hysdn_log_mutex);
return (-EPERM); /* no permission this time */
}
unlock_kernel();
mutex_unlock(&hysdn_log_mutex);
return nonseekable_open(ino, filep);
} /* hysdn_log_open */

Expand All @@ -300,7 +301,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
hysdn_card *card;
int retval = 0;

lock_kernel();
mutex_lock(&hysdn_log_mutex);
if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
/* write only access -> write debug level written */
retval = 0; /* success */
Expand Down Expand Up @@ -339,7 +340,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
kfree(inf);
}
} /* read access */
unlock_kernel();
mutex_unlock(&hysdn_log_mutex);

return (retval);
} /* hysdn_log_close */
Expand Down
Loading

0 comments on commit 1fb2366

Please sign in to comment.