提交 a32d5b72 编写于 作者: B Brian Norris

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: NBayi Cheng <bayi.cheng@mediatek.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Cc: Bayi Cheng <bayi.cheng@mediatek.com>
上级 67b9bcd3
......@@ -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;
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册