summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-22 14:40:42 -0700
committerGerrit <chrome-bot@google.com>2012-07-23 11:03:32 -0700
commit93f2e8213325741b189841d57c849c1f55651ff2 (patch)
tree50645be28417d87986f5d67273092e91cbd29f39
parent7693bbd2e44f26b62084f79643f1b6766f415ae8 (diff)
downloadchrome-ec-93f2e8213325741b189841d57c849c1f55651ff2.tar.gz
Fix unit tests not compiling for link
BUG=none TEST=make link tests Change-Id: I678b927d068bd7f1f43115a4495c16902588faa7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28140
-rw-r--r--chip/lm4/mock_flash.c9
-rw-r--r--common/flash_common.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/chip/lm4/mock_flash.c b/chip/lm4/mock_flash.c
index 8e46d52bfc..de9b278044 100644
--- a/chip/lm4/mock_flash.c
+++ b/chip/lm4/mock_flash.c
@@ -57,8 +57,13 @@ int flash_physical_get_protect(int block)
return mock_protect[block];
}
+void flash_physical_set_protect(int start_bank, int bank_count)
+{
+ for (; bank_count > 0; bank_count--)
+ mock_protect[start_bank++] = 1;
+}
-void flash_physical_set_protect(int block)
+int flash_physical_pre_init(void)
{
- mock_protect[block] = 1;
+ return EC_SUCCESS;
}
diff --git a/common/flash_common.c b/common/flash_common.c
index bfd50edac5..c496560ca1 100644
--- a/common/flash_common.c
+++ b/common/flash_common.c
@@ -47,7 +47,7 @@ static struct persist_state pstate; /* RAM copy of pstate data */
/* Return non-zero if the write protect pin is asserted */
static int wp_pin_asserted(void)
{
-#ifdef BOARD_link
+#if defined(BOARD_link) && defined(CONFIG_TASK_POWERBTN)
return write_protect_asserted();
#elif defined(CHIP_VARIANT_stm32f100)
/* Fake write protect pin */