summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf_probe.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-11-15 19:31:37 -0800
committerJagan Teki <jteki@openedev.com>2015-11-18 12:52:05 +0530
commit3e56ecec435d30e25fcffb971f8c9627e85ac1df (patch)
treec39f3924780824065a29a65be11785556fd6496f /drivers/mtd/spi/sf_probe.c
parenta668a164ffb73db6f566f50e9440c872d5293742 (diff)
downloadu-boot-imx-3e56ecec435d30e25fcffb971f8c9627e85ac1df.zip
u-boot-imx-3e56ecec435d30e25fcffb971f8c9627e85ac1df.tar.gz
u-boot-imx-3e56ecec435d30e25fcffb971f8c9627e85ac1df.tar.bz2
sf: Correct flash->flags for SST flash
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>
Diffstat (limited to 'drivers/mtd/spi/sf_probe.c')
-rw-r--r--drivers/mtd/spi/sf_probe.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index 52dace4..a619182 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -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