Skip to content

Commit

Permalink
Fix serial console on SNI RM400 machines
Browse files Browse the repository at this point in the history
[ Upstream commit e279e6d98e0cf2c2fe008b3c29042b92f0e17b1d ]

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]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tsbogend authored and gregkh committed Apr 13, 2018
1 parent a3de043 commit e56a2fd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/tty/serial/sccnxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,14 +884,19 @@ static int sccnxp_probe(struct platform_device *pdev)

clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
if (PTR_ERR(clk) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
ret = PTR_ERR(clk);
if (ret == -EPROBE_DEFER)
goto err_out;
}
uartclk = 0;
} else {
clk_prepare_enable(clk);
uartclk = clk_get_rate(clk);
}

if (!uartclk) {
dev_notice(&pdev->dev, "Using default clock frequency\n");
uartclk = s->chip->freq_std;
} else
uartclk = clk_get_rate(clk);
}

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

0 comments on commit e56a2fd

Please sign in to comment.