Skip to content

Commit

Permalink
serial: tegra: handle clk prepare error in tegra_uart_hw_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 5abd011 ]

In tegra_uart_hw_init(), the return value of clk_prepare_enable() should
be checked since it might fail.

Fixes: e9ea096 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yi Yang authored and gregkh committed Sep 13, 2023
1 parent 93e9085 commit db18d5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/tty/serial/serial-tegra.c
Expand Up @@ -999,7 +999,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);
Expand Down

0 comments on commit db18d5e

Please sign in to comment.