summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-01-05 22:24:39 -0200
committerJagan Teki <jteki@openedev.com>2016-01-07 20:29:33 +0530
commit509215835944eb7ebd4b690d3f1b8fec7d78991d (patch)
tree03d0af31c7162d2f194c064cb542ca1b80511823
parent78680314c53a95c0bb25e942662979843b60d7b9 (diff)
downloadblackbird-obmc-uboot-509215835944eb7ebd4b690d3f1b8fec7d78991d.tar.gz
blackbird-obmc-uboot-509215835944eb7ebd4b690d3f1b8fec7d78991d.zip
spi: spi_flash: Fix the arguments of stm_is_locked_sr()
stm_is_locked_sr() takes the status register (SR) value as the last parameter, not the second. Based on a patch from Brian Norris for the linux kernel: http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
-rw-r--r--drivers/mtd/spi/spi_flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 7ffa136f5a..b7b7f0044e 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -767,8 +767,8 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
return ret;
/* Cannot unlock; would unlock larger region than requested */
- if (stm_is_locked_sr(flash, status_old, ofs - flash->erase_size,
- flash->erase_size))
+ if (stm_is_locked_sr(flash, ofs - flash->erase_size, flash->erase_size,
+ status_old))
return -EINVAL;
/*
* Need largest pow such that:
OpenPOWER on IntegriCloud