spi/omap_mcspi: Off-by-one error in finding the right divisor
authorHannu Heikkinen <ext-hannu.m.heikkinen@nokia.com>
Thu, 24 Feb 2011 19:31:33 +0000 (21:31 +0200)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 24 Feb 2011 19:44:37 +0000 (12:44 -0700)
commit57d9c10dd91f942f836592f407d6351e2969548a
tree38ffc12947c93bf96de66b88d4c719913e0477f0
parent1648237dc2053bfd6ade3ce3dca3716d53cf9dcf
spi/omap_mcspi: Off-by-one error in finding the right divisor

Off-by-one error, gave erroneous divisor value 16 if speed_hz is over zero but
less than OMAP2_MCSPI_MAX_FREQ / (1 << 15), that is, [1..1463].

Also few overly complex bit shifts in divisor fixed.

Also one dev_dgb line fixed, which indicated max speed exceeding transfer speed.

Introducing a new function omap2_mcspi_calc_divisor() for getting the right
divisor in omap2_mcspi_setup_transfer().

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: Hannu Heikkinen <ext-hannu.m.heikkinen@nokia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/omap2_mcspi.c