From 53fe101c4f2e3d28d497f3b2e700e1da89d8bde8 Mon Sep 17 00:00:00 2001 From: Siva Durga Prasad Paladugu Date: Tue, 17 Mar 2015 21:23:07 +0530 Subject: [PATCH] sf: sf_probe: Get bank selection irrespective of qspi mode Get the current bank selection irrespective of qspi mode from the flash device. This solves issue of erase, read and write to wrong bank. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/mtd/spi/sf_probe.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index 393947c61b5..f0e434bd774 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -350,15 +350,13 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode, flash->bank_write_cmd = (idcode[0] == 0x01) ? CMD_BANKADDR_BRWR : CMD_EXTNADDR_WREAR; - if (flash->dual_flash == SF_DUAL_PARALLEL_FLASH) { - spi->flags |= SPI_XFER_LOWER; - ret = spi_flash_read_common(flash, - &flash->bank_read_cmd, - 1, &curr_bank, 1); - if (ret) { - debug("SF: fail to read bank addr register\n"); - return ret; - } + spi->flags |= SPI_XFER_LOWER; + ret = spi_flash_read_common(flash, + &flash->bank_read_cmd, + 1, &curr_bank, 1); + if (ret) { + debug("SF: fail to read bank addr register\n"); + return ret; } flash->bank_curr = curr_bank; } else { -- 2.47.3