提交 50921583 编写于 作者: F Fabio Estevam 提交者: Jagan Teki

spi: spi_flash: Fix the arguments of stm_is_locked_sr()

stm_is_locked_sr() takes the status register (SR) value as the last
parameter, not the second.

Based on a patch from Brian Norris for the linux kernel:
http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063eSigned-off-by: NFabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: NJagan Teki <jteki@openedev.com>
上级 78680314
......@@ -767,8 +767,8 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
return ret;
/* Cannot unlock; would unlock larger region than requested */
if (stm_is_locked_sr(flash, status_old, ofs - flash->erase_size,
flash->erase_size))
if (stm_is_locked_sr(flash, ofs - flash->erase_size, flash->erase_size,
status_old))
return -EINVAL;
/*
* Need largest pow such that:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册