/* Stores the incoming character in the ring buffer  */
static void atmel_buffer_rx_char(struct uart_port *port, unsigned int status, unsigned int ch)
/* Stores the incoming character in the ring buffer  */
static void atmel_buffer_rx_char(struct uart_port *port, unsigned int status, unsigned int ch)
{
	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
	struct circ_buf *ring = &atmel_port->rx_ring;
	struct atmel_uart_char *c;
	if (!CIRC_SPACE(ring->head, ring->tail, ATMEL_SERIAL_RINGSIZE))
		return;
	c = &((struct atmel_uart_char *)ring->buf)[ring->head];
	c->status	= status;
	c->ch		= ch;
	smp_wmb();
	ring->head = (ring->head + 1) & (ATMEL_SERIAL_RINGSIZE - 1);
}