summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-07-23 16:44:36 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-23 17:14:11 +0400
commitd76ea24ac4c92e7e0700e047fcbf716c4de2b107 (patch)
treef508efb5d6538ac20f55086ead926b43f4ad7c99 /drivers/spi
parentf814f9ac5a819542fdf6db97305db9da603c1eeb (diff)
downloadlinux-d76ea24ac4c92e7e0700e047fcbf716c4de2b107.tar.xz
spi/bcm63xx: fix clock configuration selection
We are currently using an inferior or equal operator for comparing the transfer frequency with the clock frequency table. Because of this, we always end up selecting 20Mhz as a frequency, due to the inequality transfer hz <= 20 Mhz being always true. Fix this by reversing the inequality, which is how the comparison should be done. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-bcm63xx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 7491971139a6..6e25ef1bce91 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -129,7 +129,7 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
/* Find the closest clock configuration */
for (i = 0; i < SPI_CLK_MASK; i++) {
- if (hz <= bcm63xx_spi_freq_table[i][0]) {
+ if (hz >= bcm63xx_spi_freq_table[i][0]) {
clk_cfg = bcm63xx_spi_freq_table[i][1];
break;
}