Merge git://git.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6
[cascardo/linux.git] / drivers / spi / spi_s3c24xx.c
index 34bfb7d..0885cc3 100644 (file)
@@ -125,10 +125,10 @@ static int s3c24xx_spi_setupxfer(struct spi_device *spi,
        /* is clk = pclk / (2 * (pre+1)), or is it
         *    clk = (pclk * 2) / ( pre + 1) */
 
-       div = (div / 2) - 1;
+       div /= 2;
 
-       if (div < 0)
-               div = 1;
+       if (div > 0)
+               div -= 1;
 
        if (div > 255)
                div = 255;