aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:39 -0400
commit341339e7aff33e3aa73d6c49dbd5a79be0bbec04 (patch)
tree34ad63ea28e325f14530b4b68ec99fb99f5df538 /drivers
parentf433c65b8acb5346e6fefff4e4b97711c987ccf9 (diff)
sx: prepare for BKL pushdown
Wrap the ioctl handler, and in this case the break handler also in the BKL. Remove bogus softcar handlers. Signed-off-by: Alan Cox <alan@redhat.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/sx.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index a6e1c9ba1217..e97a21db3d48 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1844,6 +1844,7 @@ static void sx_break(struct tty_struct *tty, int flag)
1844 int rv; 1844 int rv;
1845 1845
1846 func_enter(); 1846 func_enter();
1847 lock_kernel();
1847 1848
1848 if (flag) 1849 if (flag)
1849 rv = sx_send_command(port, HS_START, -1, HS_IDLE_BREAK); 1850 rv = sx_send_command(port, HS_START, -1, HS_IDLE_BREAK);
@@ -1852,7 +1853,7 @@ static void sx_break(struct tty_struct *tty, int flag)
1852 if (rv != 1) 1853 if (rv != 1)
1853 printk(KERN_ERR "sx: couldn't send break (%x).\n", 1854 printk(KERN_ERR "sx: couldn't send break (%x).\n",
1854 read_sx_byte(port->board, CHAN_OFFSET(port, hi_hstat))); 1855 read_sx_byte(port->board, CHAN_OFFSET(port, hi_hstat)));
1855 1856 unlock_kernel();
1856 func_exit(); 1857 func_exit();
1857} 1858}
1858 1859
@@ -1888,23 +1889,12 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
1888 int rc; 1889 int rc;
1889 struct sx_port *port = tty->driver_data; 1890 struct sx_port *port = tty->driver_data;
1890 void __user *argp = (void __user *)arg; 1891 void __user *argp = (void __user *)arg;
1891 int ival;
1892 1892
1893 /* func_enter2(); */ 1893 /* func_enter2(); */
1894 1894
1895 rc = 0; 1895 rc = 0;
1896 lock_kernel();
1896 switch (cmd) { 1897 switch (cmd) {
1897 case TIOCGSOFTCAR:
1898 rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
1899 (unsigned __user *)argp);
1900 break;
1901 case TIOCSSOFTCAR:
1902 if ((rc = get_user(ival, (unsigned __user *)argp)) == 0) {
1903 tty->termios->c_cflag =
1904 (tty->termios->c_cflag & ~CLOCAL) |
1905 (ival ? CLOCAL : 0);
1906 }
1907 break;
1908 case TIOCGSERIAL: 1898 case TIOCGSERIAL:
1909 rc = gs_getserial(&port->gs, argp); 1899 rc = gs_getserial(&port->gs, argp);
1910 break; 1900 break;
@@ -1915,6 +1905,7 @@ static int sx_ioctl(struct tty_struct *tty, struct file *filp,
1915 rc = -ENOIOCTLCMD; 1905 rc = -ENOIOCTLCMD;
1916 break; 1906 break;
1917 } 1907 }
1908 unlock_kernel();
1918 1909
1919 /* func_exit(); */ 1910 /* func_exit(); */
1920 return rc; 1911 return rc;