]> git.baikalelectronics.ru Git - kernel.git/commit
spi_s3c24xx: fix clock rate calculation
authorBen Dooks <ben@simtec.co.uk>
Tue, 18 Aug 2009 21:11:16 +0000 (14:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Aug 2009 23:31:13 +0000 (16:31 -0700)
commit6eaaa7f047a3ba707ac010a0b668f079b4b4b45a
treeecc74e896383a4203d0bdd679161bd419f4b430e
parent05578c547aa8625d363f8658586a6c98cb522943
spi_s3c24xx: fix clock rate calculation

Currently the clock rate calculation may round as pleased, which means
that it is possible that we will round down and end up with a faster clock
rate than intended.

Change the calculation to use DIV_ROUND_UP() to ensure that we end up with
a clock rate either the same as or lower than the user requested one.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spi_s3c24xx.c