summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-07-22 00:18:19 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-22 01:30:39 -0300
commita98ccfcf4804beb2651b9f44a4bc5cbb387019ec (patch)
treede32f2ec359c1f9da3c3cd1231c29da3d90571c7 /drivers/media/dvb-frontends
parent9aabd95a2d531308ad997d2b92f46a3635782e0c (diff)
[media] rtl2832_sdr: remove plain 64-bit divisions
Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 (v4l2-ctrls: increase internal min/max/step/def to 64 bit) changes v4l2 controls to 64-bit. Driver it not working on 32-bit arch as it uses directly control 'step' which is changed to 64-bit. Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/rtl2832_sdr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c
index f58bd746d823..023e0f49c786 100644
--- a/drivers/media/dvb-frontends/rtl2832_sdr.c
+++ b/drivers/media/dvb-frontends/rtl2832_sdr.c
@@ -1364,17 +1364,16 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl)
/* TODO: these controls should be moved to tuner drivers */
if (s->bandwidth_auto->val) {
/* Round towards the closest legal value */
- s32 val = s->f_adc + s->bandwidth->step / 2;
+ s32 val = s->f_adc + div_u64(s->bandwidth->step, 2);
u32 offset;
val = clamp_t(s32, val, s->bandwidth->minimum,
s->bandwidth->maximum);
offset = val - s->bandwidth->minimum;
offset = s->bandwidth->step *
- (offset / s->bandwidth->step);
+ div_u64(offset, s->bandwidth->step);
s->bandwidth->val = s->bandwidth->minimum + offset;
}
-
c->bandwidth_hz = s->bandwidth->val;
if (!test_bit(POWER_ON, &s->flags))