Skip to content
Snippets Groups Projects
Commit a32d5b72 authored by Brian Norris's avatar Brian Norris
Browse files

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: default avatarBayi Cheng <bayi.cheng@mediatek.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Cc: Bayi Cheng <bayi.cheng@mediatek.com>
parent 67b9bcd3
No related branches found
No related tags found
No related merge requests found
...@@ -516,8 +516,8 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) ...@@ -516,8 +516,8 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len)
status_old = read_sr(nor); status_old = read_sr(nor);
/* Cannot unlock; would unlock larger region than requested */ /* Cannot unlock; would unlock larger region than requested */
if (stm_is_locked_sr(nor, status_old, ofs - mtd->erasesize, if (stm_is_locked_sr(nor, ofs - mtd->erasesize, mtd->erasesize,
mtd->erasesize)) status_old))
return -EINVAL; return -EINVAL;
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment