mtd: spi-nor: fix stm_is_locked_sr() parameters

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 5 16:59:01 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a32d5b726ff8cf32bf491522b0ac8ae2545a063e
Commit:     a32d5b726ff8cf32bf491522b0ac8ae2545a063e
Parent:     67b9bcd36906e12a15ffec19463afbbd6a41660e
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Tue Dec 15 10:48:21 2015 -0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Jan 5 16:00:41 2016 -0800

    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 at mediatek.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Bayi Cheng <bayi.cheng at mediatek.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 4 ++--
 1 file 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;
 
 	/*



More information about the linux-mtd-cvs mailing list