mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
serial: of_serial: check the return value of clk_prepare_enable()
The function clk_prepare_enable() may fail, and in that case it does not make sense to proceed. Let's check its return code and error out if it is a negative value. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
3a63d22425
commit
6f0c3091e7
1 changed files with 4 additions and 1 deletions
|
|
@ -74,7 +74,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
|
|||
return PTR_ERR(info->clk);
|
||||
}
|
||||
|
||||
clk_prepare_enable(info->clk);
|
||||
ret = clk_prepare_enable(info->clk);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
clk = clk_get_rate(info->clk);
|
||||
}
|
||||
/* If current-speed was set, then try not to change it. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue