diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-30 18:56:14 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-08-30 18:56:14 -0300 |
commit | 502293205239f8ec860b4c33187cd7a3fc0f421c (patch) | |
tree | 3859aab46057cb3726731ca0ef65cd45c9e73660 /linux/drivers/media/dvb/frontends/tda10021.c | |
parent | 71911bc952f2394dede17c5713de0b0dfcb04fae (diff) | |
parent | 52ef68ff244a5cd4707558c9aa803ecb9c1342dc (diff) | |
download | mediapointer-dvb-s2-502293205239f8ec860b4c33187cd7a3fc0f421c.tar.gz mediapointer-dvb-s2-502293205239f8ec860b4c33187cd7a3fc0f421c.tar.bz2 |
merge: http://kernellabs.com/hg/~mkrufky/tda18271
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda10021.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda10021.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda10021.c b/linux/drivers/media/dvb/frontends/tda10021.c index c6f90f33a..f410fd5e2 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.c +++ b/linux/drivers/media/dvb/frontends/tda10021.c @@ -29,6 +29,7 @@ #include <linux/string.h> #include <linux/slab.h> +#include "compat.h" #include "dvb_frontend.h" #include "tda1002x.h" @@ -176,7 +177,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate tmp = ((symbolrate << 4) % FIN) << 8; ratio = (ratio << 8) + tmp / FIN; tmp = (tmp % FIN) << 8; - ratio = (ratio << 8) + (tmp + FIN/2) / FIN; + ratio = (ratio << 8) + DIV_ROUND_CLOSEST(tmp, FIN); BDR = ratio; BDRI = (((XIN << 5) / symbolrate) + 1) / 2; @@ -413,7 +414,7 @@ struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config, u8 id; /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct tda10021_state), GFP_KERNEL); + state = kzalloc(sizeof(struct tda10021_state), GFP_KERNEL); if (state == NULL) goto error; /* setup the state */ |