]> git.baikalelectronics.ru Git - uboot.git/commit
clk: mediatek: use unsigned type for returning the clk rate
authorFabien Parent <fparent@baylibre.com>
Thu, 17 Oct 2019 19:02:05 +0000 (21:02 +0200)
committerLukasz Majewski <lukma@denx.de>
Sun, 26 Jan 2020 11:03:06 +0000 (12:03 +0100)
commitbd2d51bbab9a4080ae9178be7fd9dca2f4e861a4
treecd9456cfdb7c0bc6bdfed5d016a8ce84502afae2
parent6b9b9be12ccf625971881c39ec28fde0431eb86a
clk: mediatek: use unsigned type for returning the clk rate

mtk_clk_find_parent_rate is calling clk_get_rate to know the rate
of a parent clock. clk_get_rate returns a ulong, while
mtk_clk_find_parent_rate returns an int. This implicit cast creates
an issue for clock rates big enough to need the full 32 bits to
store its data. When that happen the clk rate will become incorrect
because of the implicit cast between ulong -> int -> ulong.

This commit change the return type of mtk_clk_find_parent_rate to
ulong.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
drivers/clk/mediatek/clk-mtk.c