Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83387
b: refs/heads/master
c: 0a5dcb5
h: refs/heads/master
i:
  83385: dd28604
  83383: d302b80
v: v3
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Feb 6, 2008
1 parent 7d9b350 commit a97a169
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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: 8f47f0b688bba7642dac4e979896e4692177670b
refs/heads/master: 0a5dcb51770be3cd0202d6b90a07996fb40130b6
10 changes: 5 additions & 5 deletions trunk/drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
if (copy_size > LP_BUFFER_SIZE)
copy_size = LP_BUFFER_SIZE;

if (down_interruptible (&lp_table[minor].port_mutex))
if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
return -EINTR;

if (copy_from_user (kbuf, buf, copy_size)) {
Expand Down Expand Up @@ -399,7 +399,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
lp_release_parport (&lp_table[minor]);
}
out_unlock:
up (&lp_table[minor].port_mutex);
mutex_unlock(&lp_table[minor].port_mutex);

return retv;
}
Expand All @@ -421,7 +421,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
if (count > LP_BUFFER_SIZE)
count = LP_BUFFER_SIZE;

if (down_interruptible (&lp_table[minor].port_mutex))
if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
return -EINTR;

lp_claim_parport_or_block (&lp_table[minor]);
Expand Down Expand Up @@ -479,7 +479,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
if (retval > 0 && copy_to_user (buf, kbuf, retval))
retval = -EFAULT;

up (&lp_table[minor].port_mutex);
mutex_unlock(&lp_table[minor].port_mutex);

return retval;
}
Expand Down Expand Up @@ -888,7 +888,7 @@ static int __init lp_init (void)
lp_table[i].last_error = 0;
init_waitqueue_head (&lp_table[i].waitq);
init_waitqueue_head (&lp_table[i].dataq);
init_MUTEX (&lp_table[i].port_mutex);
mutex_init(&lp_table[i].port_mutex);
lp_table[i].timeout = 10 * HZ;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/lp.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#ifdef __KERNEL__

#include <linux/wait.h>
#include <asm/semaphore.h>
#include <linux/mutex.h>

/* Magic numbers for defining port-device mappings */
#define LP_PARPORT_UNSPEC -4
Expand Down Expand Up @@ -145,7 +145,7 @@ struct lp_struct {
#endif
wait_queue_head_t waitq;
unsigned int last_error;
struct semaphore port_mutex;
struct mutex port_mutex;
wait_queue_head_t dataq;
long timeout;
unsigned int best_mode;
Expand Down

0 comments on commit a97a169

Please sign in to comment.