浏览代码

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>
Brian Norris 9 年之前
父节点
当前提交
a32d5b726f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/mtd/spi-nor/spi-nor.c

+ 2 - 2
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;
 
 	/*