aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/amiserial.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-06-01 16:53:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:43 -0400
commitec79d6056de58511d8e46d9ae59d3878f958dc3e (patch)
tree8e73cf399c4cb3c31dbf3caced385cfc018a706a /drivers/char/amiserial.c
parent3f582b8c11014e4ce310d9839fb335164195333f (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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 4f8d60c25a98..1b21a7adeb58 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -1072,7 +1072,7 @@ static int get_serial_info(struct async_struct * info,
1072 if (!retinfo) 1072 if (!retinfo)
1073 return -EFAULT; 1073 return -EFAULT;
1074 memset(&tmp, 0, sizeof(tmp)); 1074 memset(&tmp, 0, sizeof(tmp));
1075 lock_kernel(); 1075 tty_lock();
1076 tmp.type = state->type; 1076 tmp.type = state->type;
1077 tmp.line = state->line; 1077 tmp.line = state->line;
1078 tmp.port = state->port; 1078 tmp.port = state->port;
@@ -1083,7 +1083,7 @@ static int get_serial_info(struct async_struct * info,
1083 tmp.close_delay = state->close_delay; 1083 tmp.close_delay = state->close_delay;
1084 tmp.closing_wait = state->closing_wait; 1084 tmp.closing_wait = state->closing_wait;
1085 tmp.custom_divisor = state->custom_divisor; 1085 tmp.custom_divisor = state->custom_divisor;
1086 unlock_kernel(); 1086 tty_unlock();
1087 if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) 1087 if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
1088 return -EFAULT; 1088 return -EFAULT;
1089 return 0; 1089 return 0;
@@ -1100,14 +1100,14 @@ static int set_serial_info(struct async_struct * info,
1100 if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) 1100 if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
1101 return -EFAULT; 1101 return -EFAULT;
1102 1102
1103 lock_kernel(); 1103 tty_lock();
1104 state = info->state; 1104 state = info->state;
1105 old_state = *state; 1105 old_state = *state;
1106 1106
1107 change_irq = new_serial.irq != state->irq; 1107 change_irq = new_serial.irq != state->irq;
1108 change_port = (new_serial.port != state->port); 1108 change_port = (new_serial.port != state->port);
1109 if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) { 1109 if(change_irq || change_port || (new_serial.xmit_fifo_size != state->xmit_fifo_size)) {
1110 unlock_kernel(); 1110 tty_unlock();
1111 return -EINVAL; 1111 return -EINVAL;
1112 } 1112 }
1113 1113
@@ -1127,7 +1127,7 @@ static int set_serial_info(struct async_struct * info,
1127 } 1127 }
1128 1128
1129 if (new_serial.baud_base < 9600) { 1129 if (new_serial.baud_base < 9600) {
1130 unlock_kernel(); 1130 tty_unlock();
1131 return -EINVAL; 1131 return -EINVAL;
1132 } 1132 }
1133 1133
@@ -1163,7 +1163,7 @@ check_and_exit:
1163 } 1163 }
1164 } else 1164 } else
1165 retval = startup(info); 1165 retval = startup(info);
1166 unlock_kernel(); 1166 tty_unlock();
1167 return retval; 1167 return retval;
1168} 1168}
1169 1169
@@ -1538,7 +1538,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
1538 1538
1539 orig_jiffies = jiffies; 1539 orig_jiffies = jiffies;
1540 1540
1541 lock_kernel(); 1541 tty_lock_nested(); /* tty_wait_until_sent is called from lots of places */
1542 /* 1542 /*
1543 * Set the check interval to be 1/5 of the estimated time to 1543 * Set the check interval to be 1/5 of the estimated time to
1544 * send a single character, and make it at least 1. The check 1544 * 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)
1579 break; 1579 break;
1580 } 1580 }
1581 __set_current_state(TASK_RUNNING); 1581 __set_current_state(TASK_RUNNING);
1582 unlock_kernel(); 1582 tty_unlock();
1583#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT 1583#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
1584 printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); 1584 printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
1585#endif 1585#endif