diff options
author | Alan Cox <alan@redhat.com> | 2009-01-02 08:48:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:19:42 -0500 |
commit | 6b447f04a9aecdf2a30c1a97e4b034ac7931bb70 (patch) | |
tree | 61a92b936c0c8e42ebf93e01acbc15aceb9bd864 /drivers/usb/serial/ftdi_sio.c | |
parent | eeb4613436f0f19a38f667ea3078821040559c68 (diff) |
tty: Drop the lock_kernel in the private ioctl hook
We don't need the BKL here any more so it can go. In a couple of spots the
driver requirements are not clear so push the lock down into the driver.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index fb6f2933b01b..ef6cfa5a447f 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1054,6 +1054,8 @@ static int set_serial_info(struct tty_struct *tty, | |||
1054 | 1054 | ||
1055 | if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) | 1055 | if (copy_from_user(&new_serial, newinfo, sizeof(new_serial))) |
1056 | return -EFAULT; | 1056 | return -EFAULT; |
1057 | |||
1058 | lock_kernel(); | ||
1057 | old_priv = *priv; | 1059 | old_priv = *priv; |
1058 | 1060 | ||
1059 | /* Do error checking and permission checking */ | 1061 | /* Do error checking and permission checking */ |
@@ -1069,8 +1071,10 @@ static int set_serial_info(struct tty_struct *tty, | |||
1069 | } | 1071 | } |
1070 | 1072 | ||
1071 | if ((new_serial.baud_base != priv->baud_base) && | 1073 | if ((new_serial.baud_base != priv->baud_base) && |
1072 | (new_serial.baud_base < 9600)) | 1074 | (new_serial.baud_base < 9600)) { |
1075 | unlock_kernel(); | ||
1073 | return -EINVAL; | 1076 | return -EINVAL; |
1077 | } | ||
1074 | 1078 | ||
1075 | /* Make the changes - these are privileged changes! */ | 1079 | /* Make the changes - these are privileged changes! */ |
1076 | 1080 | ||
@@ -1098,8 +1102,11 @@ check_and_exit: | |||
1098 | (priv->flags & ASYNC_SPD_MASK)) || | 1102 | (priv->flags & ASYNC_SPD_MASK)) || |
1099 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && | 1103 | (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && |
1100 | (old_priv.custom_divisor != priv->custom_divisor))) { | 1104 | (old_priv.custom_divisor != priv->custom_divisor))) { |
1105 | unlock_kernel(); | ||
1101 | change_speed(tty, port); | 1106 | change_speed(tty, port); |
1102 | } | 1107 | } |
1108 | else | ||
1109 | unlock_kernel(); | ||
1103 | return 0; | 1110 | return 0; |
1104 | 1111 | ||
1105 | } /* set_serial_info */ | 1112 | } /* set_serial_info */ |