projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67b9bcd
)
mtd: spi-nor: fix stm_is_locked_sr() parameters
author
Brian Norris
<
[email protected]
>
Tue, 15 Dec 2015 18:48:21 +0000
(10:48 -0800)
committer
Brian Norris
<
[email protected]
>
Wed, 6 Jan 2016 00:00:41 +0000
(16:00 -0800)
stm_is_locked_sr() takes the status register (SR) value as the last
parameter, not the second.
Reported-by: Bayi Cheng <
[email protected]
>
Signed-off-by: Brian Norris <
[email protected]
>
Cc: Bayi Cheng <
[email protected]
>
drivers/mtd/spi-nor/spi-nor.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/spi-nor/spi-nor.c
b/drivers/mtd/spi-nor/spi-nor.c
index f5d59de1ee6e9b3cffcbea6882c6935d24d28a8f..32477c4eb421390e250645f94b0eefdab871a043 100644
(file)
--- a/
drivers/mtd/spi-nor/spi-nor.c
+++ b/
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;
/*