From 0290de8bceee72486a85a1e3a4fe5927394b38cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klemens=20Sch=C3=B6lhorn?= Date: Sun, 20 May 2018 23:12:47 +0200 Subject: [PATCH] sifive-serial: register uart port as console before adding it The console can be set up as soon as uart_add_one_port is called. So we have to register the uart port as a console before that. Otherwise sifive_serial_console_setup fails and there is no console at all. --- drivers/tty/serial/sifive.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c index 588fb31cc94d0..a367d258f9a93 100644 --- a/drivers/tty/serial/sifive.c +++ b/drivers/tty/serial/sifive.c @@ -965,17 +965,18 @@ static int sifive_serial_probe(struct platform_device *pdev) goto probe_out2; } + sifive_serial_add_console_port(ssp); + r = uart_add_one_port(&sifive_serial_uart_driver, &ssp->port); if (r != 0) { dev_err(&pdev->dev, "could not add uart: %d\n", r); goto probe_out3; } - sifive_serial_add_console_port(ssp); - return 0; probe_out3: + sifive_serial_remove_console_port(ssp); free_irq(ssp->port.irq, ssp); probe_out2: clk_notifier_unregister(ssp->clk, &ssp->clk_notifier);