Fix long-lasting bug that causes tuning failure of some frequencies
on 32-bit arch.

Special thanks goes to Damien CABROL who finally find root of the bug.
Also big thanks to Jacek Konieczny for donating "non-working" device.

[cr...@iki.fi: fix trivial merge conflict]
Reported-by: Jacek Konieczny <jaj...@jajcus.net>
Reported-by: Torsten Seyffarth <t.seyffa...@gmx.de>
Reported-by: Jan Taegert <jantaeg...@gmx.net>
Reported-by: Damien CABROL <cabrol.dam...@free.fr>
Tested-by: Damien CABROL <cabrol.dam...@free.fr>
Tested-by: Jan Taegert <jantaeg...@gmx.net>
Signed-off-by: Antti Palosaari <cr...@iki.fi>
---
 drivers/media/tuners/e4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
index ad9309d..54e2d8a 100644
--- a/drivers/media/tuners/e4000.c
+++ b/drivers/media/tuners/e4000.c
@@ -233,7 +233,7 @@ static int e4000_set_params(struct dvb_frontend *fe)
         * or more.
         */
        f_vco = c->frequency * e4000_pll_lut[i].mul;
-       sigma_delta = 0x10000UL * (f_vco % priv->cfg->clock) / priv->cfg->clock;
+       sigma_delta = div_u64(0x10000ULL * (f_vco % priv->cfg->clock), 
priv->cfg->clock);
        buf[0] = f_vco / priv->cfg->clock;
        buf[1] = (sigma_delta >> 0) & 0xff;
        buf[2] = (sigma_delta >> 8) & 0xff;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to