Commit 6f6412b4 authored by Alan Cox's avatar Alan Cox Committed by Live-CD User

isicom: Split the close hardware bits out

Start to extract and build a model for a common tty_port_close()
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
parent 1e2b0254
...@@ -952,19 +952,12 @@ static void isicom_flush_buffer(struct tty_struct *tty) ...@@ -952,19 +952,12 @@ static void isicom_flush_buffer(struct tty_struct *tty)
tty_wakeup(tty); tty_wakeup(tty);
} }
static void isicom_close(struct tty_struct *tty, struct file *filp) static void isicom_close_port(struct tty_port *port)
{ {
struct isi_port *ip = tty->driver_data; struct isi_port *ip = container_of(port, struct isi_port, port);
struct tty_port *port = &ip->port; struct isi_board *card = ip->card;
struct isi_board *card;
unsigned long flags; unsigned long flags;
BUG_ON(!ip);
card = ip->card;
if (isicom_paranoia_check(ip, tty->name, "isicom_close"))
return;
/* indicate to the card that no more data can be received /* indicate to the card that no more data can be received
on this port */ on this port */
spin_lock_irqsave(&card->card_lock, flags); spin_lock_irqsave(&card->card_lock, flags);
...@@ -974,9 +967,19 @@ static void isicom_close(struct tty_struct *tty, struct file *filp) ...@@ -974,9 +967,19 @@ static void isicom_close(struct tty_struct *tty, struct file *filp)
} }
isicom_shutdown_port(ip); isicom_shutdown_port(ip);
spin_unlock_irqrestore(&card->card_lock, flags); spin_unlock_irqrestore(&card->card_lock, flags);
}
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
struct isi_port *ip = tty->driver_data;
struct tty_port *port = &ip->port;
if (isicom_paranoia_check(ip, tty->name, "isicom_close"))
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
isicom_close_port(port);
isicom_flush_buffer(tty); isicom_flush_buffer(tty);
tty_port_close_end(port, tty); tty_port_close_end(port, tty);
} }
......
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