diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-12-15 10:48:21 -0800 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2016-01-05 16:00:41 -0800 |
commit | a32d5b726ff8cf32bf491522b0ac8ae2545a063e (patch) | |
tree | c8621a5503e3495c6f6223695dff6dc77234a35c | |
parent | 67b9bcd36906e12a15ffec19463afbbd6a41660e (diff) | |
download | op-kernel-dev-a32d5b726ff8cf32bf491522b0ac8ae2545a063e.zip op-kernel-dev-a32d5b726ff8cf32bf491522b0ac8ae2545a063e.tar.gz |
mtd: spi-nor: fix stm_is_locked_sr() parameters
stm_is_locked_sr() takes the status register (SR) value as the last
parameter, not the second.
Reported-by: Bayi Cheng <bayi.cheng@mediatek.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Bayi Cheng <bayi.cheng@mediatek.com>
-rw-r--r-- | drivers/mtd/spi-nor/spi-nor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index f5d59de..32477c4 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -516,8 +516,8 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) status_old = read_sr(nor); /* Cannot unlock; would unlock larger region than requested */ - if (stm_is_locked_sr(nor, status_old, ofs - mtd->erasesize, - mtd->erasesize)) + if (stm_is_locked_sr(nor, ofs - mtd->erasesize, mtd->erasesize, + status_old)) return -EINVAL; /* |