summaryrefslogtreecommitdiff
path: root/futility/updater_dut.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/updater_dut.c')
-rw-r--r--futility/updater_dut.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/futility/updater_dut.c b/futility/updater_dut.c
index 6cb03727..634fd447 100644
--- a/futility/updater_dut.c
+++ b/futility/updater_dut.c
@@ -107,7 +107,7 @@ static int dut_get_tpm_fwver(struct updater_config *cfg)
static int dut_get_wp_hw(struct updater_config *cfg)
{
/* wpsw refers to write protection 'switch', not 'software'. */
- return dut_get_property_int("wpsw_cur", cfg) ? WP_ENABLED : WP_DISABLED;
+ return dut_get_property_int("wpsw_cur", cfg);
}
static int dut_get_platform_version(struct updater_config *cfg)
@@ -125,7 +125,13 @@ static int dut_get_platform_version(struct updater_config *cfg)
static int dut_get_wp_sw(struct updater_config *cfg)
{
assert(cfg->image.programmer);
- return flashrom_get_wp(cfg->image.programmer, -1);
+ bool mode;
+
+ if (flashrom_get_wp(cfg->image.programmer, &mode, NULL, NULL, -1)) {
+ /* Read WP status error */
+ return -1;
+ }
+ return mode;
}
/* Helper functions to use or configure the DUT properties. */