summaryrefslogtreecommitdiff
path: root/drivers/media/common
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/xc4000.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c
index be43a6dfac6c..f50dd6e713f7 100644
--- a/drivers/media/common/tuners/xc4000.c
+++ b/drivers/media/common/tuners/xc4000.c
@@ -417,8 +417,9 @@ static int xc_get_frequency_error(struct xc4000_priv *priv, u32 *freq_error_hz)
if (result != XC_RESULT_SUCCESS)
return result;
- tmp = (u32)regData;
- (*freq_error_hz) = (tmp * 15625) / 1000;
+ tmp = (u32)regData & 0xFFFFU;
+ tmp = (tmp < 0x8000U ? tmp : 0x10000U - tmp);
+ (*freq_error_hz) = tmp * 15625;
return result;
}