]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: spi-nor: fix stm_is_locked_sr() parameters
authorBrian Norris <computersforpeace@gmail.com>
Tue, 15 Dec 2015 18:48:21 +0000 (10:48 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 6 Jan 2016 00:00:41 +0000 (16:00 -0800)
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>
drivers/mtd/spi-nor/spi-nor.c

index f5d59de1ee6e9b3cffcbea6882c6935d24d28a8f..32477c4eb421390e250645f94b0eefdab871a043 100644 (file)
@@ -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;
 
        /*