spi: spi_flash: Fix the arguments of stm_is_locked_sr()
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
From: Fabio Estevam <[email protected]>
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/commitdiff/a32d5b726ff8cf32bf491522b0ac8ae2545a063e?hp=67b9bcd36906e12a15ffec19463afbbd6a41660e
--- drivers/mtd/spi/spi_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/spi/spi_flash.c +2 -2
@@ -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:
Signature · 1 line
1.9.1
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
Quoted 7 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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/commitdiff/a32d5b726ff8cf32bf491522b0ac8ae2545a063e?hp=67b9bcd36906e12a15ffec19463afbbd6a41660e
This link seems too long
What about this?
http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e
Quoted 23 lines
Signed-off-by Fabio Estevam <[email protected]>--- drivers/mtd/spi/spi_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mtd/spi/spi_flash.c +2
-3@@ -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: -- 1.9.1
Signature · 1 line
Jagan.
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
Quoted 5 lines · Jagan Teki
This link seems too long
What about this?
http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e
Care to fix this while applying it?
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
Quoted 9 lines · Fabio Estevam
Quoted 5 lines · Jagan Teki
This link seems too long
What about this?
http://git.infradead.org/linux-mtd.git/commit/a32d5b726ff8cf32bf491522b0ac8ae2545a063e
Care to fix this while applying it?
And also did you test this?
Signature · 1 line
Jagan.
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
Quoted 1 line · Jagan Teki
And also did you test this?
Yes, on a mx6qsabresd.
PATCH 1/1 spi: spi_flash: Fix the arguments of stm_is_locked_sr()
Quoted 6 lines · Fabio Estevam
Quoted 1 line · Jagan Teki
And also did you test this?
Yes, on a mx6qsabresd.
Applied to u-boot-spi/master
Signature · 1 line
Jagan