From 83ba5e93c1b11280a1835809321ab828fa2c000e Mon Sep 17 00:00:00 2001 From: Nikolai Artemiev Date: Tue, 22 Oct 2024 13:00:45 +1100 Subject: [PATCH] writeprotect: Fix inaccurate return code If hardware protection is requested but not supported by the flash chip, return an error code indicating that the protection mode is unsupported, rather than indicating that all WP features are unsupported. TEST=ninja test Change-Id: I29e9069c7781fbb238f30aa9a9285b692b0c7200 Signed-off-by: Nikolai Artemiev Reviewed-on: https://review.coreboot.org/c/flashrom/+/84826 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk --- writeprotect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writeprotect.c b/writeprotect.c index 411089def..964c31120 100644 --- a/writeprotect.c +++ b/writeprotect.c @@ -482,7 +482,7 @@ static int set_wp_mode(struct wp_bits *bits, const enum flashrom_wp_mode mode) 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;