diff options
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 */ |