/* This routine returns the chars number in the transmission buffer o returns 0  */
static int cpc_tty_chars_in_buffer(struct tty_struct *tty)
/* This routine returns the chars number in the transmission buffer o returns 0  */
static int cpc_tty_chars_in_buffer(struct tty_struct *tty)
{
	st_cpc_tty_area    *cpc_tty; 
	if (!tty || !tty->driver_data ) {
		CPC_TTY_DBG("hdlcX-tty: no TTY to chars in buffer\n");
		return -ENODEV; 
	}
	cpc_tty = (st_cpc_tty_area *) tty->driver_data; 
	if ((cpc_tty->tty != tty) || (cpc_tty->state != CPC_TTY_ST_OPEN)) { 
		CPC_TTY_DBG("%s: TTY is not opened\n",cpc_tty->name);
		return -ENODEV; 
	}
	return(0); 
}