diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-15 13:56:01 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-15 13:56:01 -0300 |
commit | 136a9b83fb4cb819c2f27cbb5948d26cec0e7934 (patch) | |
tree | 397919f977ae7937aa60a5001f62f0ba3faef2db /linux/drivers/media/dvb/frontends/ves1820.c | |
parent | fdafaa4f7e2ea516dbd7791f362f05273aaaa6cc (diff) | |
parent | c5d1ee111d9e00f9ce75e48e5e3806fdcd681a83 (diff) | |
download | mediapointer-dvb-s2-136a9b83fb4cb819c2f27cbb5948d26cec0e7934.tar.gz mediapointer-dvb-s2-136a9b83fb4cb819c2f27cbb5948d26cec0e7934.tar.bz2 |
merge: http://kernellabs.com/hg/~mkrufky/tda18271-merge
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/ves1820.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1820.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index a184597f1..afd7f09ac 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -27,6 +27,7 @@ #include <linux/slab.h> #include <asm/div64.h> +#include "compat.h" #include "dvb_frontend.h" #include "ves1820.h" @@ -165,7 +166,7 @@ static int ves1820_set_symbolrate(struct ves1820_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 = (((state->config->xin << 5) / symbolrate) + 1) / 2; @@ -374,7 +375,7 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, struct ves1820_state* state = NULL; /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct ves1820_state), GFP_KERNEL); + state = kzalloc(sizeof(struct ves1820_state), GFP_KERNEL); if (state == NULL) goto error; |