/* Check if transmitter in idle (tx reg empty)  */
static u32 stm_port_tx_empty(struct uart_port *port)
/* Check if transmitter in idle (tx reg empty)  */
static u32 stm_port_tx_empty(struct uart_port *port)
{
	volatile struct stm32_usart_regs	*uart = stm32_usart(port);
	unsigned long				flags;
	u32					rv;
	spin_lock_irqsave(&port->lock, flags);
	rv = (uart->sr & STM32_USART_SR_TXE) ? TIOCSER_TEMT : 0;
	spin_unlock_irqrestore(&port->lock, flags);
	return rv;
}