/* Close down an X.25 channel. This means flushing out any pending queues, and then restoring the TTY line discipline to what it was before it got hooked to X.25 (which usually is TTY again).  */
static void x25_asy_close_tty(struct tty_struct *tty)
/* Close down an X.25 channel. This means flushing out any pending queues, and then restoring the TTY line discipline to what it was before it got hooked to X.25 (which usually is TTY again).  */
static void x25_asy_close_tty(struct tty_struct *tty)
{
	struct x25_asy *sl = tty->disc_data;
	if (!sl || sl->magic != X25_ASY_MAGIC)
		return;
	rtnl_lock();
	if (sl->dev->flags & IFF_UP)
		dev_close(sl->dev);
	rtnl_unlock();
	tty->disc_data = NULL;
	sl->tty = NULL;
	x25_asy_free(sl);
}