diff options
-rw-r--r-- | drivers/char/isicom.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 4f1f4cd670da..08f574333a57 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -952,19 +952,12 @@ static void isicom_flush_buffer(struct tty_struct *tty) | |||
952 | tty_wakeup(tty); | 952 | tty_wakeup(tty); |
953 | } | 953 | } |
954 | 954 | ||
955 | static void isicom_close(struct tty_struct *tty, struct file *filp) | 955 | static void isicom_close_port(struct tty_port *port) |
956 | { | 956 | { |
957 | struct isi_port *ip = tty->driver_data; | 957 | struct isi_port *ip = container_of(port, struct isi_port, port); |
958 | struct tty_port *port = &ip->port; | 958 | struct isi_board *card = ip->card; |
959 | struct isi_board *card; | ||
960 | unsigned long flags; | 959 | unsigned long flags; |
961 | 960 | ||
962 | BUG_ON(!ip); | ||
963 | |||
964 | card = ip->card; | ||
965 | if (isicom_paranoia_check(ip, tty->name, "isicom_close")) | ||
966 | return; | ||
967 | |||
968 | /* indicate to the card that no more data can be received | 961 | /* indicate to the card that no more data can be received |
969 | on this port */ | 962 | on this port */ |
970 | spin_lock_irqsave(&card->card_lock, flags); | 963 | spin_lock_irqsave(&card->card_lock, flags); |
@@ -974,9 +967,19 @@ static void isicom_close(struct tty_struct *tty, struct file *filp) | |||
974 | } | 967 | } |
975 | isicom_shutdown_port(ip); | 968 | isicom_shutdown_port(ip); |
976 | spin_unlock_irqrestore(&card->card_lock, flags); | 969 | spin_unlock_irqrestore(&card->card_lock, flags); |
970 | } | ||
977 | 971 | ||
972 | static void isicom_close(struct tty_struct *tty, struct file *filp) | ||
973 | { | ||
974 | struct isi_port *ip = tty->driver_data; | ||
975 | struct tty_port *port = &ip->port; | ||
976 | if (isicom_paranoia_check(ip, tty->name, "isicom_close")) | ||
977 | return; | ||
978 | |||
979 | if (tty_port_close_start(port, tty, filp) == 0) | ||
980 | return; | ||
981 | isicom_close_port(port); | ||
978 | isicom_flush_buffer(tty); | 982 | isicom_flush_buffer(tty); |
979 | |||
980 | tty_port_close_end(port, tty); | 983 | tty_port_close_end(port, tty); |
981 | } | 984 | } |
982 | 985 | ||