Merge tag 'platform-drivers-x86-v4.5-1' of git://git.infradead.org/users/dvhart/linux...
[linux-2.6-block.git] / drivers / spi / spi-bcm63xx.c
index bf9a610e5b898106af79e49a586d7ad4061ef4e0..fee747030ee67e4cf2e81ab0a8e6329e861675eb 100644 (file)
@@ -207,6 +207,9 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
        u8 clk_cfg, reg;
        int i;
 
+       /* Default to lowest clock configuration */
+       clk_cfg = SPI_CLK_0_391MHZ;
+
        /* Find the closest clock configuration */
        for (i = 0; i < SPI_CLK_MASK; i++) {
                if (t->speed_hz >= bcm63xx_spi_freq_table[i][0]) {
@@ -215,10 +218,6 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
                }
        }
 
-       /* No matching configuration found, default to lowest */
-       if (i == SPI_CLK_MASK)
-               clk_cfg = SPI_CLK_0_391MHZ;
-
        /* clear existing clock configuration bits of the register */
        reg = bcm_spi_readb(bs, SPI_CLK_CFG);
        reg &= ~SPI_CLK_MASK;