diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-04-08 19:24:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:39 -0400 |
commit | 5f99feffc0426f88db07e2d777d9dd4aa2205c2f (patch) | |
tree | 59bbf3ce39cf5b3febf30e940f505b5df5d06e8b /drivers | |
parent | f430fff101dd2cdbf5db1cf274a1591ae2b6e05c (diff) |
V4L/DVB (11590): stv090x: code simplification
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index fee7917ec5c2..b3a02790c9a2 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c | |||
@@ -2351,19 +2351,16 @@ static enum stv090x_signal_state stv090x_get_sig_params(struct stv090x_state *st | |||
2351 | static u32 stv090x_get_tmgoffst(struct stv090x_state *state, u32 srate) | 2351 | static u32 stv090x_get_tmgoffst(struct stv090x_state *state, u32 srate) |
2352 | { | 2352 | { |
2353 | s32 offst_tmg; | 2353 | s32 offst_tmg; |
2354 | s32 pow2; | ||
2355 | 2354 | ||
2356 | offst_tmg = STV090x_READ_DEMOD(state, TMGREG2) << 16; | 2355 | offst_tmg = STV090x_READ_DEMOD(state, TMGREG2) << 16; |
2357 | offst_tmg |= STV090x_READ_DEMOD(state, TMGREG1) << 8; | 2356 | offst_tmg |= STV090x_READ_DEMOD(state, TMGREG1) << 8; |
2358 | offst_tmg |= STV090x_READ_DEMOD(state, TMGREG0); | 2357 | offst_tmg |= STV090x_READ_DEMOD(state, TMGREG0); |
2359 | 2358 | ||
2360 | pow2 = 1 << 24; | ||
2361 | |||
2362 | offst_tmg = comp2(offst_tmg, 24); /* 2's complement */ | 2359 | offst_tmg = comp2(offst_tmg, 24); /* 2's complement */ |
2363 | if (!offst_tmg) | 2360 | if (!offst_tmg) |
2364 | offst_tmg = 1; | 2361 | offst_tmg = 1; |
2365 | 2362 | ||
2366 | offst_tmg = ((s32) srate * 10) / (pow2 / offst_tmg); | 2363 | offst_tmg = ((s32) srate * 10) / ((s32) 0x1000000 / offst_tmg); |
2367 | offst_tmg /= 320; | 2364 | offst_tmg /= 320; |
2368 | 2365 | ||
2369 | return offst_tmg; | 2366 | return offst_tmg; |