All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: linux-kernel@vger.kernel.org,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Daniel Kurtz" <djkurtz@chromium.org>,
	"Marek Vasut" <marex@denx.de>,
	"Bayi Cheng" <bayi.cheng@mediatek.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Felix Fietkau" <nbd@openwrt.org>,
	"Eddie Huang (黃智傑)" <eddie.huang@mediatek.com>,
	"Milton Chiang (江明晏)" <Milton.Chiang@mediatek.com>
Subject: [PATCH for-4.4 2/2] mtd: spi-nor: fix stm_is_locked_sr() parameters
Date: Tue, 15 Dec 2015 10:48:21 -0800	[thread overview]
Message-ID: <1450205301-32207-2-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1450205301-32207-1-git-send-email-computersforpeace@gmail.com>

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

Reported-by: Bayi Cheng <bayi.cheng@mediatek.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Bayi Cheng <bayi.cheng@mediatek.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
 
 	/*
-- 
2.6.0.rc2.230.g3dd15c0

  reply	other threads:[~2015-12-15 18:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 18:48 [PATCH for-4.4 1/2] mtd: spi-nor: fix Spansion regressions (aliased with Winbond) Brian Norris
2015-12-15 18:48 ` Brian Norris [this message]
2016-01-05  2:30   ` [PATCH for-4.4 2/2] mtd: spi-nor: fix stm_is_locked_sr() parameters Brian Norris
2016-01-05  2:29 ` [PATCH for-4.4 1/2] mtd: spi-nor: fix Spansion regressions (aliased with Winbond) Brian Norris
2016-01-06  0:02   ` Brian Norris
2016-01-06  0:03     ` Felix Fietkau
2016-01-06  2:07       ` bayi cheng
2016-03-26 18:57 ` Matthias Schiffer
2016-03-27 22:52   ` Matthias Schiffer
2016-03-28 20:56     ` Brian Norris
2016-03-29 19:14       ` Matthias Schiffer
2016-03-30 12:47       ` Cyrille Pitchen
2016-04-01  3:05         ` James Cameron
2016-04-01 20:27         ` Brian Norris
2016-04-04 15:33           ` Cyrille Pitchen
2016-04-26  5:54             ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450205301-32207-2-git-send-email-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=Milton.Chiang@mediatek.com \
    --cc=bayi.cheng@mediatek.com \
    --cc=djkurtz@chromium.org \
    --cc=eddie.huang@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=nbd@openwrt.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.