/* So this is used by sn_sal_serial_console_init (early on, before we're registered with serial core). It's also used by sn_sal_module_init right after we've registered with serial core. The later only happens if we didn't already come through here via sn_sal_serial_console_init.  */
static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port)
/* So this is used by sn_sal_serial_console_init (early on, before we're registered with serial core). It's also used by sn_sal_module_init right after we've registered with serial core. The later only happens if we didn't already come through here via sn_sal_serial_console_init.  */
static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port)
{
	unsigned long flags;
	if (!port)
		return;
	DPRINTF("sn_console: about to switch to asynchronous console\n");
	spin_lock_irqsave(&port->sc_port.lock, flags);
	if (!port->sc_ops)
		port->sc_ops = &poll_ops;
	init_timer(&port->sc_timer);
	port->sc_timer.function = sn_sal_timer_poll;
	port->sc_timer.data = (unsigned long)port;
	if (IS_RUNNING_ON_SIMULATOR())
		port->sc_interrupt_timeout = 6;
	else {
		port->sc_interrupt_timeout =
		    HZ * SN_SAL_UART_FIFO_DEPTH / SN_SAL_UART_FIFO_SPEED_CPS;
	}
	mod_timer(&port->sc_timer, jiffies + port->sc_interrupt_timeout);
	port->sc_is_asynch = 1;
	spin_unlock_irqrestore(&port->sc_port.lock, flags);
}