From: Enrico Scholz Date: Wed, 4 Feb 2015 14:53:32 +0000 (-0300) Subject: [media] mt9p031: fixed calculation of clk_div X-Git-Tag: firefly_0821_release~176^2~795^2~1144 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=198b47ddd23498cd88f4ec2c2a050eb727cc357c;p=firefly-linux-kernel-4.4.55.git [media] mt9p031: fixed calculation of clk_div There must be used 'min_t', not 'max_t' for calculating the divider. Signed-off-by: Enrico Scholz Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index c56a58b47c78..e06759c6cb91 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -251,7 +251,7 @@ static int mt9p031_clk_setup(struct mt9p031 *mt9p031) div = DIV_ROUND_UP(pdata->ext_freq, pdata->target_freq); div = roundup_pow_of_two(div) / 2; - mt9p031->clk_div = max_t(unsigned int, div, 64); + mt9p031->clk_div = min_t(unsigned int, div, 64); mt9p031->use_pll = false; return 0;