Skip to content

Commit e279e6d

Browse files
tsbogendgregkh
authored andcommitted
Fix serial console on SNI RM400 machines
sccnxp driver doesn't get the correct uart clock rate, if CONFIG_HAVE_CLOCK is disabled. Correct usage of clk API to make it work with/without it. Fixes: 90efa75 (serial: sccnxp: Using CLK API for getting UART clock) Suggested-by: Russell King - ARM Linux <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8a8dabf commit e279e6d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/tty/serial/sccnxp.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,14 +884,19 @@ static int sccnxp_probe(struct platform_device *pdev)
884884

885885
clk = devm_clk_get(&pdev->dev, NULL);
886886
if (IS_ERR(clk)) {
887-
if (PTR_ERR(clk) == -EPROBE_DEFER) {
888-
ret = -EPROBE_DEFER;
887+
ret = PTR_ERR(clk);
888+
if (ret == -EPROBE_DEFER)
889889
goto err_out;
890-
}
890+
uartclk = 0;
891+
} else {
892+
clk_prepare_enable(clk);
893+
uartclk = clk_get_rate(clk);
894+
}
895+
896+
if (!uartclk) {
891897
dev_notice(&pdev->dev, "Using default clock frequency\n");
892898
uartclk = s->chip->freq_std;
893-
} else
894-
uartclk = clk_get_rate(clk);
899+
}
895900

896901
/* Check input frequency */
897902
if ((uartclk < s->chip->freq_min) || (uartclk > s->chip->freq_max)) {

0 commit comments

Comments
 (0)