aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2008-02-06 04:36:25 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:01 -0500
commit0a5dcb51770be3cd0202d6b90a07996fb40130b6 (patch)
tree75ac6d5c64be71369126e8ad05b62b59576df4e7 /drivers
parent8f47f0b688bba7642dac4e979896e4692177670b (diff)
Parallel port: convert port_mutex to the mutex API
Parallel port: Convert port_mutex to the mutex API [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/lp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 81674d7c56c7..60ac642752be 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -312,7 +312,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
312 if (copy_size > LP_BUFFER_SIZE) 312 if (copy_size > LP_BUFFER_SIZE)
313 copy_size = LP_BUFFER_SIZE; 313 copy_size = LP_BUFFER_SIZE;
314 314
315 if (down_interruptible (&lp_table[minor].port_mutex)) 315 if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
316 return -EINTR; 316 return -EINTR;
317 317
318 if (copy_from_user (kbuf, buf, copy_size)) { 318 if (copy_from_user (kbuf, buf, copy_size)) {
@@ -399,7 +399,7 @@ static ssize_t lp_write(struct file * file, const char __user * buf,
399 lp_release_parport (&lp_table[minor]); 399 lp_release_parport (&lp_table[minor]);
400 } 400 }
401out_unlock: 401out_unlock:
402 up (&lp_table[minor].port_mutex); 402 mutex_unlock(&lp_table[minor].port_mutex);
403 403
404 return retv; 404 return retv;
405} 405}
@@ -421,7 +421,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
421 if (count > LP_BUFFER_SIZE) 421 if (count > LP_BUFFER_SIZE)
422 count = LP_BUFFER_SIZE; 422 count = LP_BUFFER_SIZE;
423 423
424 if (down_interruptible (&lp_table[minor].port_mutex)) 424 if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
425 return -EINTR; 425 return -EINTR;
426 426
427 lp_claim_parport_or_block (&lp_table[minor]); 427 lp_claim_parport_or_block (&lp_table[minor]);
@@ -479,7 +479,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
479 if (retval > 0 && copy_to_user (buf, kbuf, retval)) 479 if (retval > 0 && copy_to_user (buf, kbuf, retval))
480 retval = -EFAULT; 480 retval = -EFAULT;
481 481
482 up (&lp_table[minor].port_mutex); 482 mutex_unlock(&lp_table[minor].port_mutex);
483 483
484 return retval; 484 return retval;
485} 485}
@@ -888,7 +888,7 @@ static int __init lp_init (void)
888 lp_table[i].last_error = 0; 888 lp_table[i].last_error = 0;
889 init_waitqueue_head (&lp_table[i].waitq); 889 init_waitqueue_head (&lp_table[i].waitq);
890 init_waitqueue_head (&lp_table[i].dataq); 890 init_waitqueue_head (&lp_table[i].dataq);
891 init_MUTEX (&lp_table[i].port_mutex); 891 mutex_init(&lp_table[i].port_mutex);
892 lp_table[i].timeout = 10 * HZ; 892 lp_table[i].timeout = 10 * HZ;
893 } 893 }
894 894