/* Return a refcount protected tty instance or NULL if the port is not associated with a tty (eg due to close or hangup)  */
struct tty_struct* tty_port_tty_get(struct tty_port *port)
/* Return a refcount protected tty instance or NULL if the port is not associated with a tty (eg due to close or hangup)  */
struct tty_struct* tty_port_tty_get(struct tty_port *port)
{
	unsigned long flags;
	struct tty_struct *tty;
	spin_lock_irqsave(&port->lock, flags);
	tty = tty_kref_get(port->tty);
	spin_unlock_irqrestore(&port->lock, flags);
	return tty;
}