diff options
author | Alan Cox <alan@linux.intel.com> | 2010-06-01 16:52:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:40 -0400 |
commit | 7479db07011c9c85a65eeb03724193230af0a99d (patch) | |
tree | d4020fc59b97fb25e48fddb0825df6d15a34c73d /drivers/char | |
parent | 7cc34fd028ef35b12fec0fa9268c37c099d33bd2 (diff) |
specialix: Kill the BKL
Use the port mutex instead
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/specialix.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 2c24fcdc722..7be456f760c 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -1863,8 +1863,7 @@ static int sx_set_serial_info(struct specialix_port *port, | |||
1863 | return -EFAULT; | 1863 | return -EFAULT; |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | lock_kernel(); | 1866 | mutex_lock(&port->port.mutex); |
1867 | |||
1868 | change_speed = ((port->port.flags & ASYNC_SPD_MASK) != | 1867 | change_speed = ((port->port.flags & ASYNC_SPD_MASK) != |
1869 | (tmp.flags & ASYNC_SPD_MASK)); | 1868 | (tmp.flags & ASYNC_SPD_MASK)); |
1870 | change_speed |= (tmp.custom_divisor != port->custom_divisor); | 1869 | change_speed |= (tmp.custom_divisor != port->custom_divisor); |
@@ -1875,7 +1874,7 @@ static int sx_set_serial_info(struct specialix_port *port, | |||
1875 | ((tmp.flags & ~ASYNC_USR_MASK) != | 1874 | ((tmp.flags & ~ASYNC_USR_MASK) != |
1876 | (port->port.flags & ~ASYNC_USR_MASK))) { | 1875 | (port->port.flags & ~ASYNC_USR_MASK))) { |
1877 | func_exit(); | 1876 | func_exit(); |
1878 | unlock_kernel(); | 1877 | mutex_unlock(&port->port.mutex); |
1879 | return -EPERM; | 1878 | return -EPERM; |
1880 | } | 1879 | } |
1881 | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | | 1880 | port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) | |
@@ -1892,7 +1891,7 @@ static int sx_set_serial_info(struct specialix_port *port, | |||
1892 | sx_change_speed(bp, port); | 1891 | sx_change_speed(bp, port); |
1893 | 1892 | ||
1894 | func_exit(); | 1893 | func_exit(); |
1895 | unlock_kernel(); | 1894 | mutex_unlock(&port->port.mutex); |
1896 | return 0; | 1895 | return 0; |
1897 | } | 1896 | } |
1898 | 1897 | ||
@@ -1906,7 +1905,7 @@ static int sx_get_serial_info(struct specialix_port *port, | |||
1906 | func_enter(); | 1905 | func_enter(); |
1907 | 1906 | ||
1908 | memset(&tmp, 0, sizeof(tmp)); | 1907 | memset(&tmp, 0, sizeof(tmp)); |
1909 | lock_kernel(); | 1908 | mutex_lock(&port->port.mutex); |
1910 | tmp.type = PORT_CIRRUS; | 1909 | tmp.type = PORT_CIRRUS; |
1911 | tmp.line = port - sx_port; | 1910 | tmp.line = port - sx_port; |
1912 | tmp.port = bp->base; | 1911 | tmp.port = bp->base; |
@@ -1917,7 +1916,7 @@ static int sx_get_serial_info(struct specialix_port *port, | |||
1917 | tmp.closing_wait = port->port.closing_wait * HZ/100; | 1916 | tmp.closing_wait = port->port.closing_wait * HZ/100; |
1918 | tmp.custom_divisor = port->custom_divisor; | 1917 | tmp.custom_divisor = port->custom_divisor; |
1919 | tmp.xmit_fifo_size = CD186x_NFIFO; | 1918 | tmp.xmit_fifo_size = CD186x_NFIFO; |
1920 | unlock_kernel(); | 1919 | mutex_unlock(&port->port.mutex); |
1921 | if (copy_to_user(retinfo, &tmp, sizeof(tmp))) { | 1920 | if (copy_to_user(retinfo, &tmp, sizeof(tmp))) { |
1922 | func_exit(); | 1921 | func_exit(); |
1923 | return -EFAULT; | 1922 | return -EFAULT; |