mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 13:43:28 +00:00
serial: s5p: Fix clk_get_by_index() error code check
clk_get_by_index() returns negative number on error. Assigning it to
unsigned int makes the subsequent "ret < 0" check always false, leading
in turn to possible unhandled errors. Change 'ret' variable type to
signed int so the code checks and handles clk_get_by_index() return code
properly.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: cf75cdf96e
("serial: s5p: use clock api to get clock rate")
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
parent
08cfa971a7
commit
2227f4c0af
1 changed files with 1 additions and 1 deletions
|
@ -118,7 +118,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate)
|
|||
|
||||
#if IS_ENABLED(CONFIG_CLK_EXYNOS) || IS_ENABLED(CONFIG_ARCH_APPLE)
|
||||
struct clk clk;
|
||||
u32 ret;
|
||||
int ret;
|
||||
|
||||
ret = clk_get_by_index(dev, 1, &clk);
|
||||
if (ret < 0)
|
||||
|
|
Loading…
Reference in a new issue