]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] mt9p031: fixed calculation of clk_div
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
Wed, 4 Feb 2015 14:53:32 +0000 (11:53 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 3 Apr 2015 00:19:04 +0000 (21:19 -0300)
There must be used 'min_t', not 'max_t' for calculating the divider.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/mt9p031.c

index c56a58b47c78737a2dd96856f8461ed538767696..e06759c6cb910899c33d158f1ad552a89191e436 100644 (file)
@@ -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;