Commit 7479db07 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

specialix: Kill the BKL

Use the port mutex instead
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7cc34fd0
...@@ -1863,8 +1863,7 @@ static int sx_set_serial_info(struct specialix_port *port, ...@@ -1863,8 +1863,7 @@ static int sx_set_serial_info(struct specialix_port *port,
return -EFAULT; return -EFAULT;
} }
lock_kernel(); mutex_lock(&port->port.mutex);
change_speed = ((port->port.flags & ASYNC_SPD_MASK) != change_speed = ((port->port.flags & ASYNC_SPD_MASK) !=
(tmp.flags & ASYNC_SPD_MASK)); (tmp.flags & ASYNC_SPD_MASK));
change_speed |= (tmp.custom_divisor != port->custom_divisor); change_speed |= (tmp.custom_divisor != port->custom_divisor);
...@@ -1875,7 +1874,7 @@ static int sx_set_serial_info(struct specialix_port *port, ...@@ -1875,7 +1874,7 @@ static int sx_set_serial_info(struct specialix_port *port,
((tmp.flags & ~ASYNC_USR_MASK) != ((tmp.flags & ~ASYNC_USR_MASK) !=
(port->port.flags & ~ASYNC_USR_MASK))) { (port->port.flags & ~ASYNC_USR_MASK))) {
func_exit(); func_exit();
unlock_kernel(); mutex_unlock(&port->port.mutex);
return -EPERM; return -EPERM;
} }
port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
...@@ -1892,7 +1891,7 @@ static int sx_set_serial_info(struct specialix_port *port, ...@@ -1892,7 +1891,7 @@ static int sx_set_serial_info(struct specialix_port *port,
sx_change_speed(bp, port); sx_change_speed(bp, port);
func_exit(); func_exit();
unlock_kernel(); mutex_unlock(&port->port.mutex);
return 0; return 0;
} }
...@@ -1906,7 +1905,7 @@ static int sx_get_serial_info(struct specialix_port *port, ...@@ -1906,7 +1905,7 @@ static int sx_get_serial_info(struct specialix_port *port,
func_enter(); func_enter();
memset(&tmp, 0, sizeof(tmp)); memset(&tmp, 0, sizeof(tmp));
lock_kernel(); mutex_lock(&port->port.mutex);
tmp.type = PORT_CIRRUS; tmp.type = PORT_CIRRUS;
tmp.line = port - sx_port; tmp.line = port - sx_port;
tmp.port = bp->base; tmp.port = bp->base;
...@@ -1917,7 +1916,7 @@ static int sx_get_serial_info(struct specialix_port *port, ...@@ -1917,7 +1916,7 @@ static int sx_get_serial_info(struct specialix_port *port,
tmp.closing_wait = port->port.closing_wait * HZ/100; tmp.closing_wait = port->port.closing_wait * HZ/100;
tmp.custom_divisor = port->custom_divisor; tmp.custom_divisor = port->custom_divisor;
tmp.xmit_fifo_size = CD186x_NFIFO; tmp.xmit_fifo_size = CD186x_NFIFO;
unlock_kernel(); mutex_unlock(&port->port.mutex);
if (copy_to_user(retinfo, &tmp, sizeof(tmp))) { if (copy_to_user(retinfo, &tmp, sizeof(tmp))) {
func_exit(); func_exit();
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment