[U-Boot] [PATCH] video: ipu: Use lldiv() for 64-bit division in ipu_pixel_clk_set_rate()
Andrew Shadura
andrew.shadura at collabora.co.uk
Thu May 19 11:48:18 CEST 2016
Fix compilation problems with a hardfloat toolchain on ARM
(libgcc.a(_udivmoddi4.o) uses VFP register arguments, u-boot does not).
Cast clk->parent->rate to u64 before the multiplication to avoid
overflowing a 32-bit value.
Bug introduced by 3cb4f25cc702db17455583599d0940c81337a17a.
Signed-off-by: Andrew Shadura <andrew.shadura at collabora.co.uk>
---
drivers/video/ipu_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index 36d4b23..dad3e6f 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -352,7 +352,7 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate)
*/
__raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id));
- clk->rate = (u64)(clk->parent->rate * 16) / div;
+ clk->rate = lldiv((u64)clk->parent->rate * 16, div);
return 0;
}
--
2.7.4
More information about the U-Boot
mailing list