diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-06-01 22:53:01 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 13:47:43 -0700 |
commit | ec79d6056de58511d8e46d9ae59d3878f958dc3e (patch) | |
tree | 8e73cf399c4cb3c31dbf3caced385cfc018a706a /drivers/char/amiserial.c | |
parent | 3f582b8c11014e4ce310d9839fb335164195333f (diff) |
tty: replace BKL with a new tty_lock
As a preparation for replacing the big kernel lock
in the TTY layer, wrap all the callers in new
macros tty_lock, tty_lock_nested and tty_unlock.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/amiserial.c')
-rw-r--r-- | drivers/char/amiserial.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 4f8d60c25a9..1b21a7adeb5 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -1072,7 +1072,7 @@ static int get_serial_info(struct async_struct * info, if (!retinfo) return -EFAULT; memset(&tmp, 0, sizeof(tmp)); - lock_kernel(); + tty_lock(); tmp.type = state->type; tmp.line = state->line; tmp.port = state->port; @@ -1083,7 +1083,7 @@ static int get_serial_info(struct async_struct * info, tmp.close_delay = state->close_delay; tmp.closing_wait = state->closing_wait; tmp.custom_divisor = state->custom_divisor; - unlock_kernel(); + tty_unlock(); if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) return -EFAULT; return 0; @@ -1100,14 +1100,14 @@ static int set_serial_info(struct async_struct * info, if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) return -EFAULT; - lock_kernel(); + tty_lock(); state = info->state; old_state = *state; change_irq = new_serial.irq != state->irq; change_port = (new_serial.port != state->port); if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) { - unlock_kernel(); + tty_unlock(); return -EINVAL; } @@ -1127,7 +1127,7 @@ static int set_serial_info(struct async_struct * info, } if (new_serial.baud_base < 9600) { - unlock_kernel(); + tty_unlock(); return -EINVAL; } @@ -1163,7 +1163,7 @@ check_and_exit: } } else retval = startup(info); - unlock_kernel(); + tty_unlock(); return retval; } @@ -1538,7 +1538,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) orig_jiffies = jiffies; - lock_kernel(); + tty_lock_nested(); /* tty_wait_until_sent is called from lots of places */ /* * Set the check interval to be 1/5 of the estimated time to * send a single character, and make it at least 1. The check @@ -1579,7 +1579,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) break; } __set_current_state(TASK_RUNNING); - unlock_kernel(); + tty_unlock(); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); #endif |