]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/dvb/frontends/ves1820.c
V4L/DVB (13965): zl10039, jump to error on error
[mv-sheeva.git] / drivers / media / dvb / frontends / ves1820.c
index 6e78e486551599bc47d76addb4e0af3e284175b6..550a07a8a9975d253b9e39482d5e4cc0b040adb8 100644 (file)
@@ -165,7 +165,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;