Nikolai Artemiev has uploaded this change for review.

View Change

writeprotect: Fix inaccurate return code

If the user requests hardware protection on a chip that doesn't support
it, return an error code indicating that the protection mode is
unsupported, rather than indicating that the chip is unsupported, since
other WP operations may still be available.

TEST=ninja test

Change-Id: I29e9069c7781fbb238f30aa9a9285b692b0c7200
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
---
M writeprotect.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/26/84826/1
diff --git a/writeprotect.c b/writeprotect.c
index 411089d..964c311 100644
--- a/writeprotect.c
+++ b/writeprotect.c
@@ -482,7 +482,7 @@

case FLASHROM_WP_MODE_HARDWARE:
if (!bits->srp_bit_present)
- return FLASHROM_WP_ERR_CHIP_UNSUPPORTED;
+ return FLASHROM_WP_ERR_MODE_UNSUPPORTED;

bits->srl = 0;
bits->srp = 1;

To view, visit change 84826. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I29e9069c7781fbb238f30aa9a9285b692b0c7200
Gerrit-Change-Number: 84826
Gerrit-PatchSet: 1
Gerrit-Owner: Nikolai Artemiev <nartemiev@google.com>