From: Mauro Carvalho Chehab Date: Tue, 31 Jul 2012 19:38:41 +0000 (-0300) Subject: [media] radio-tea5777: use library for 64bits div X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2f2da1e2995c9362babd7da3cc9d340be184ea73;p=openwrt%2Fstaging%2Fblogic.git [media] radio-tea5777: use library for 64bits div drivers/built-in.o: In function `radio_tea5777_set_freq': radio-tea5777.c:(.text+0x4d8704): undefined reference to `__udivdi3' Reported-by: Randy Dunlap Cc: Hans de Goede Acked-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c index 3e12179364f8..5bc9fa62720b 100644 --- a/drivers/media/radio/radio-tea5777.c +++ b/drivers/media/radio/radio-tea5777.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "radio-tea5777.h" MODULE_AUTHOR("Hans de Goede "); @@ -158,10 +159,11 @@ static int radio_tea5777_set_freq(struct radio_tea5777 *tea) int res; freq = clamp_t(u32, tea->freq, - TEA5777_FM_RANGELOW, TEA5777_FM_RANGEHIGH); - freq = (freq + 8) / 16; /* to kHz */ + TEA5777_FM_RANGELOW, TEA5777_FM_RANGEHIGH) + 8; + do_div(freq, 16); /* to kHz */ - freq = (freq - TEA5777_FM_IF) / TEA5777_FM_FREQ_STEP; + freq -= TEA5777_FM_IF; + do_div(freq, TEA5777_FM_FREQ_STEP); tea->write_reg &= ~(TEA5777_W_FM_PLL_MASK | TEA5777_W_FM_FREF_MASK); tea->write_reg |= freq << TEA5777_W_FM_PLL_SHIFT;