mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock()
authorJoakim Tjernlund <joakim.tjernlund@infinera.com>
Wed, 6 Jun 2018 10:13:27 +0000 (12:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:24:55 +0000 (11:24 +0200)
commit80349943d56c1fdf361e6cf2f1f44ca7d210675c
tree2ea30e205e241b23564ed3dd384a73d4e37a004b
parent746c1362c434d4c4d48eb53fa0ef757bc191e55f
mtd: cfi_cmdset_0002: Use right chip in do_ppb_xxlock()

commit f93aa8c4de307069c270b2d81741961162bead6c upstream.

do_ppb_xxlock() fails to add chip->start when querying for lock status
(and chip_ready test), which caused false status reports.
Fix that by adding adr += chip->start and adjust call sites
accordingly.

Fixes: 1648eaaa1575 ("mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking")
Cc: stable@vger.kernel.org
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/chips/cfi_cmdset_0002.c