/* Locking: locks called line discipline but ldisc poll method may be re-entered freely by other callers.  */
static unsigned int tty_poll(struct file *, poll_table *)
/* Locking: locks called line discipline but ldisc poll method may be re-entered freely by other callers.  */
static unsigned int tty_poll(struct file *, poll_table *)
{
	struct tty_struct *tty;
	struct tty_ldisc *ld;
	int ret = 0;
	tty = (struct tty_struct *)filp->private_data;
	if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_poll"))
		return 0;
	ld = tty_ldisc_ref_wait(tty);
	if (ld->ops->poll)
		ret = (ld->ops->poll)(tty, filp, wait);
	tty_ldisc_deref(ld);
	return ret;
}