From 6f6c268b0f1f6846584162053a47d3aadf34a3c4 Mon Sep 17 00:00:00 2001 From: Reinhard Nissl Date: Mon, 21 Jan 2008 16:15:14 -0300 Subject: [PATCH] V4L/DVB (9447): stb6100: improve rounding Optimization: Round the requested value to achieve a +/-1MHz error instead of +0/-2MHz Signed-off-by: Reinhard Nissl Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/stb6100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/stb6100.c b/drivers/media/dvb/frontends/stb6100.c index 0259a4689507..5c6d06775dd5 100644 --- a/drivers/media/dvb/frontends/stb6100.c +++ b/drivers/media/dvb/frontends/stb6100.c @@ -276,7 +276,7 @@ static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) else if (bandwidth <= 5000000) /* bw/2 min = 5Mhz for F=0 */ tmp = 0; else /* if 5 < bw/2 < 36 */ - tmp = bandwidth / 1000000 - 5; + tmp = (bandwidth + 500000) / 1000000 - 5; /* Turn on LPF bandwidth setting clock control, * set bandwidth, wait 10ms, turn off. -- 2.39.5