/* serport_ldisc_open() is the routine that is called upon setting our line discipline on a tty. It prepares the serio struct.  */
static int serport_ldisc_open(struct tty_struct *tty)
/* serport_ldisc_open() is the routine that is called upon setting our line discipline on a tty. It prepares the serio struct.  */
static int serport_ldisc_open(struct tty_struct *tty)
{
	struct serport *serport;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	serport = kzalloc(sizeof(struct serport), GFP_KERNEL);
	if (!serport)
		return -ENOMEM;
	serport->tty = tty;
	spin_lock_init(&serport->lock);
	init_waitqueue_head(&serport->wait);
	tty->disc_data = serport;
	tty->receive_room = 256;
	set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
	return 0;
}