Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] tua9001: use div_u64() for frequency calculation

Use div_u64() to simplify and remove home made divides.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
47f95dbd dd219a87

+2 -8
+1 -8
drivers/media/tuners/tua9001.c
··· 88 88 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 89 89 int ret, i; 90 90 u16 val; 91 - u32 frequency; 92 91 struct tua9001_reg_val data[2]; 93 92 94 93 dev_dbg(&client->dev, ··· 121 122 122 123 data[0].reg = 0x04; 123 124 data[0].val = val; 124 - 125 - frequency = (c->frequency - 150000000); 126 - frequency /= 100; 127 - frequency *= 48; 128 - frequency /= 10000; 129 - 130 125 data[1].reg = 0x1f; 131 - data[1].val = frequency; 126 + data[1].val = div_u64((u64) (c->frequency - 150000000) * 48, 1000000); 132 127 133 128 if (fe->callback) { 134 129 ret = fe->callback(client->adapter,
+1
drivers/media/tuners/tua9001_priv.h
··· 18 18 #define TUA9001_PRIV_H 19 19 20 20 #include "tua9001.h" 21 + #include <linux/math64.h> 21 22 #include <linux/regmap.h> 22 23 23 24 struct tua9001_reg_val {