diff options
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r-- | drivers/media/tuners/fc2580.c | 6 | ||||
-rw-r--r-- | drivers/media/tuners/fc2580_priv.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c index 3aecaf465094..f0c9c42867de 100644 --- a/drivers/media/tuners/fc2580.c +++ b/drivers/media/tuners/fc2580.c | |||
@@ -195,7 +195,7 @@ static int fc2580_set_params(struct dvb_frontend *fe) | |||
195 | 195 | ||
196 | f_ref = 2UL * priv->cfg->clock / r_val; | 196 | f_ref = 2UL * priv->cfg->clock / r_val; |
197 | n_val = div_u64_rem(f_vco, f_ref, &k_val); | 197 | n_val = div_u64_rem(f_vco, f_ref, &k_val); |
198 | k_val_reg = 1UL * k_val * (1 << 20) / f_ref; | 198 | k_val_reg = div_u64(1ULL * k_val * (1 << 20), f_ref); |
199 | 199 | ||
200 | ret = fc2580_wr_reg(priv, 0x18, r18_val | ((k_val_reg >> 16) & 0xff)); | 200 | ret = fc2580_wr_reg(priv, 0x18, r18_val | ((k_val_reg >> 16) & 0xff)); |
201 | if (ret < 0) | 201 | if (ret < 0) |
@@ -348,8 +348,8 @@ static int fc2580_set_params(struct dvb_frontend *fe) | |||
348 | if (ret < 0) | 348 | if (ret < 0) |
349 | goto err; | 349 | goto err; |
350 | 350 | ||
351 | ret = fc2580_wr_reg(priv, 0x37, 1UL * priv->cfg->clock * \ | 351 | ret = fc2580_wr_reg(priv, 0x37, div_u64(1ULL * priv->cfg->clock * |
352 | fc2580_if_filter_lut[i].mul / 1000000000); | 352 | fc2580_if_filter_lut[i].mul, 1000000000)); |
353 | if (ret < 0) | 353 | if (ret < 0) |
354 | goto err; | 354 | goto err; |
355 | 355 | ||
diff --git a/drivers/media/tuners/fc2580_priv.h b/drivers/media/tuners/fc2580_priv.h index be38a9e637e0..646c99452136 100644 --- a/drivers/media/tuners/fc2580_priv.h +++ b/drivers/media/tuners/fc2580_priv.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define FC2580_PRIV_H | 22 | #define FC2580_PRIV_H |
23 | 23 | ||
24 | #include "fc2580.h" | 24 | #include "fc2580.h" |
25 | #include <linux/math64.h> | ||
25 | 26 | ||
26 | struct fc2580_reg_val { | 27 | struct fc2580_reg_val { |
27 | u8 reg; | 28 | u8 reg; |