David Hendricks would like Brian Norris to review this change.

View Change

mtd: print a hint for users when lock/unlock fails

Some people have trouble with error messages. Let's make this one more
obvious.

BRANCH=none
BUG=chrome-os-partner:54736
TEST=`flashrom --wp-disable`, when WP# is asserted (and therefore you
can't change the flash Status Register)

Change-Id: I4fe40c88da2faad9a9df40da9f9df216ed5119af
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/363925
Reviewed-by: David Hendricks <dhendrix@chromium.org>
---
M linux_mtd.c
1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/10/22510/1
diff --git a/linux_mtd.c b/linux_mtd.c
index cd12d29..99a7ec0 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -450,6 +450,7 @@
if (ioctl(dev_fd, MEMUNLOCK, &entire_chip) == -1) {
msg_perr("%s: Failed to disable write-protection, ioctl: %s\n",
__func__, strerror(errno));
+ msg_perr("Did you disable WP#?\n");
return 1;
}

@@ -476,6 +477,7 @@

if (ioctl(dev_fd, MEMUNLOCK, &erase_info) == -1) {
msg_perr("%s: ioctl: %s\n", __func__, strerror(errno));
+ msg_perr("Did you disable WP#?\n");
return 1;
}

To view, visit change 22510. To unsubscribe, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fe40c88da2faad9a9df40da9f9df216ed5119af
Gerrit-Change-Number: 22510
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Brian Norris <briannorris@chromium.org>