From: Sakari Ailus <sakari.ai...@iki.fi>

Required added multiplier (and divisor) calculation did not take into
account the existing divisor when checking the values against the minimum
divisor. Do just that.

Signed-off-by: Sakari Ailus <sakari.ai...@iki.fi>
---
 drivers/media/i2c/smiapp-pll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index e3348db..5ad1edb 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -227,7 +227,8 @@ static int __smiapp_pll_calculate(
 
        more_mul_factor = lcm(div, pll->pre_pll_clk_div) / div;
        dev_dbg(dev, "more_mul_factor: %u\n", more_mul_factor);
-       more_mul_factor = lcm(more_mul_factor, op_limits->min_sys_clk_div);
+       more_mul_factor = lcm(more_mul_factor,
+                             DIV_ROUND_UP(op_limits->min_sys_clk_div, div));
        dev_dbg(dev, "more_mul_factor: min_op_sys_clk_div: %d\n",
                more_mul_factor);
        i = roundup(more_mul_min, more_mul_factor);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to