From: Brian Norris Date: Tue, 15 Dec 2015 18:48:21 +0000 (-0800) Subject: mtd: spi-nor: fix stm_is_locked_sr() parameters X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a32d5b726ff8cf32bf491522b0ac8ae2545a063e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Bayi Cheng Signed-off-by: Brian Norris Cc: Bayi Cheng --- diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index f5d59de1ee6e..32477c4eb421 100644 --- 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; /*