]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/spi/spi_bfin5xx.c
Blackfin SPI Driver: fix bug - spi controller driver does not assert/deassert CS...
[linux-2.6-omap-h63xx.git] / drivers / spi / spi_bfin5xx.c
index 317731a9cd6ddb56ce1f234eeb8883dd16c0572d..122292557bf35890dfcc868974ef769975ed9f86 100644 (file)
@@ -189,6 +189,7 @@ static void cs_deactive(struct driver_data *drv_data, struct chip_data *chip)
 {
        u16 flag = read_FLAG(drv_data);
 
+       flag &= ~chip->flag;
        flag |= (chip->flag << 8);
 
        write_FLAG(drv_data, flag);
@@ -1036,7 +1037,6 @@ static int setup(struct spi_device *spi)
        struct bfin5xx_spi_chip *chip_info = NULL;
        struct chip_data *chip;
        struct driver_data *drv_data = spi_master_get_devdata(spi->master);
-       u8 spi_flg;
 
        /* Abort device setup if requested features are not supported */
        if (spi->mode & ~(SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST)) {
@@ -1119,8 +1119,7 @@ static int setup(struct spi_device *spi)
         * SPI_BAUD, not the real baudrate
         */
        chip->baud = hz_to_spi_baud(spi->max_speed_hz);
-       spi_flg = ~(1 << (spi->chip_select));
-       chip->flag = ((u16) spi_flg << 8) | (1 << (spi->chip_select));
+       chip->flag = 1 << (spi->chip_select);
        chip->chip_select_num = spi->chip_select;
 
        switch (chip->bits_per_word) {