/* Read UART ID using the divisor method - set DLL and DLM to zero and the revision will be in DLL and device type in DLM. We preserve the device state across this.  */
static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
/* Read UART ID using the divisor method - set DLL and DLM to zero and the revision will be in DLL and device type in DLM. We preserve the device state across this.  */
static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
{
	unsigned char old_dll, old_dlm, old_lcr;
	unsigned int id;
	old_lcr = serial_inp(p, UART_LCR);
	serial_outp(p, UART_LCR, UART_LCR_DLAB);
	old_dll = serial_inp(p, UART_DLL);
	old_dlm = serial_inp(p, UART_DLM);
	serial_outp(p, UART_DLL, 0);
	serial_outp(p, UART_DLM, 0);
	id = serial_inp(p, UART_DLL) | serial_inp(p, UART_DLM) << 8;
	serial_outp(p, UART_DLL, old_dll);
	serial_outp(p, UART_DLM, old_dlm);
	serial_outp(p, UART_LCR, old_lcr);
	return id;
}