mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
serial: tegra: handle clk prepare error in tegra_uart_hw_init()
In tegra_uart_hw_init(), the return value of clk_prepare_enable() should
be checked since it might fail.
Fixes: e9ea096dd2
("serial: tegra: add serial driver")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Link: https://lore.kernel.org/r/20230817105406.228674-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8a6498f2b9
commit
5abd01145d
@ -996,7 +996,11 @@ static int tegra_uart_hw_init(struct tegra_uart_port *tup)
|
||||
tup->ier_shadow = 0;
|
||||
tup->current_baud = 0;
|
||||
|
||||
clk_prepare_enable(tup->uart_clk);
|
||||
ret = clk_prepare_enable(tup->uart_clk);
|
||||
if (ret) {
|
||||
dev_err(tup->uport.dev, "could not enable clk\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Reset the UART controller to clear all previous status.*/
|
||||
reset_control_assert(tup->rst);
|
||||
|
Loading…
Reference in New Issue
Block a user