From: Michal Simek Date: Mon, 23 Apr 2018 08:55:21 +0000 (+0200) Subject: tty: serial: xuartps: Setup early console when uartclk is also passed X-Git-Tag: v4.17-rc3~18^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66dd99c2033684169f04068f66c7f83f7da229b8;p=thirdparty%2Fkernel%2Flinux.git tty: serial: xuartps: Setup early console when uartclk is also passed Baudrate calculation depends on requested baudrate and uart clock. This patch is checking that uartclk is also passed. The same logic is used 8250_early.c/init_port function. Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index abcb4d09a2d86..bd72dd843338d 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device, /* only set baud if specified on command line - otherwise * assume it has been initialized by a boot loader. */ - if (device->baud) { + if (port->uartclk && device->baud) { u32 cd = 0, bdiv = 0; u32 mr; int div8;