]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sf: Correct flash->flags for SST flash
authorBin Meng <bmeng.cn@gmail.com>
Mon, 16 Nov 2015 03:31:37 +0000 (19:31 -0800)
committerJagan Teki <jteki@openedev.com>
Wed, 18 Nov 2015 07:22:05 +0000 (12:52 +0530)
flash->flags for SST flash should be updated for both DM and non-DM
flash drivers.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
drivers/mtd/spi/sf_probe.c

index 52dace42eeaa1a6858879a4ce262170eb29de4ec..a619182a75e7d7fc45637ea3686ef6b205489390 100644 (file)
@@ -164,14 +164,15 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode,
        flash->memory_map = spi->memory_map;
        flash->dual_flash = flash->spi->option;
 
+       /* Assign spi flash flags */
+       if (params->flags & SST_WR)
+               flash->flags |= SNOR_F_SST_WR;
+
        /* Assign spi_flash ops */
 #ifndef CONFIG_DM_SPI_FLASH
        flash->write = spi_flash_cmd_write_ops;
 #if defined(CONFIG_SPI_FLASH_SST)
-       if (params->flags & SST_WR)
-               flash->flags |= SNOR_F_SST_WR;
-
-       if (params->flags & SNOR_F_SST_WR) {
+       if (flash->flags & SNOR_F_SST_WR) {
                if (flash->spi->op_mode_tx & SPI_OPM_TX_BP)
                        flash->write = sst_write_bp;
                else