/* Locking: tty_mutex must be held. If tty is found, the mutex must be held until the 'fast-open' is also done. Will change once we have refcounting in the driver and per driver locking  */
static struct tty_struct* tty_driver_lookup_tty(struct tty_driver *driver, struct inode *inode, int idx)
/* Locking: tty_mutex must be held. If tty is found, the mutex must be held until the 'fast-open' is also done. Will change once we have refcounting in the driver and per driver locking  */
static struct tty_struct* tty_driver_lookup_tty(struct tty_driver *driver, struct inode *inode, int idx)
{
	struct tty_struct *tty;
	if (driver->ops->lookup)
		return driver->ops->lookup(driver, inode, idx);
	tty = driver->ttys[idx];
	return tty;
}