]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/spi_s3c24xx.c
[MTD] [NAND] drivers/mtd/nand/nandsim.c needs div64.h
[linux-2.6-omap-h63xx.git] / drivers / spi / spi_s3c24xx.c
index b7476b888197c7872ce24cde39a552f9c74095b4..1c643c9e1f15ff793e5d7c140e9f93ee96320544 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;
@@ -169,7 +169,7 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
        }
 
        dev_dbg(&spi->dev, "%s: mode %d, %u bpw, %d hz\n",
-               __FUNCTION__, spi->mode, spi->bits_per_word,
+               __func__, spi->mode, spi->bits_per_word,
                spi->max_speed_hz);
 
        return 0;
@@ -270,6 +270,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
        /* setup the master state. */
 
        master->num_chipselect = hw->pdata->num_cs;
+       master->bus_num = pdata->bus_num;
 
        /* setup the state for the bitbang driver */