The build fails for 32-bit targets with:
arm-linux-gnueabi-ld: drivers/media/platform/synopsys/hdmirx/snps_hdmirx.o: in function `hdmirx_get_timings':
snps_hdmirx.c:(.text.hdmirx_get_timings+0x46c): undefined reference to `__aeabi_uldivmod'
bt->pixelclock is __u64, which causes the compiler to emit a libcall for
64-bit division. Use the optimized kernel helper, div_u64(), to resolve
this.
Fixes: 7b59b132ad43 ("media: platform: synopsys: Add support for HDMI input driver")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mfd/syscon.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
hfp = htotal - hact - hs - hbp;
vfp = vtotal - vact - vs - vbp;
- fps = (bt->pixelclock + (htotal * vtotal) / 2) / (htotal * vtotal);
+ fps = div_u64(bt->pixelclock + (htotal * vtotal) / 2, htotal * vtotal);
bt->width = hact;
bt->height = vact;
bt->hfrontporch = hfp;