summaryrefslogtreecommitdiff
path: root/chip/lm4/flash.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-06-10 11:04:01 -0700
committerChromeBot <chrome-bot@google.com>2013-06-10 13:59:34 -0700
commit0b8f5a3a6ca9722e4c7bc931577b08616e31d72a (patch)
tree4ccd00f8bb3a6b95a95506a8c1494a19c4e15096 /chip/lm4/flash.c
parentcbee574e6487e2f7dd12c4ed5f2bef8ae7c4b9cb (diff)
downloadchrome-ec-0b8f5a3a6ca9722e4c7bc931577b08616e31d72a.tar.gz
Define watchdog_reload() to nothing if not CONFIG_WATCHDOG
Currently, we need to have #ifdefs everywhere watchdog_reload() is called. With this fix we don't. Also don't bother including unused hardware timer watchdog code if the watchdog isn't defined. No change when CONFIG_WATCHDOG is defined (which it is for all normal builds). BUG=chrome-os-partner:20056 BRANCH=none TEST=build all platforms with CONFIG_WATCHDOG commented out in config.h Change-Id: Id3ce33af1a497eda127a4892e13651d9d2534d92 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/58094 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'chip/lm4/flash.c')
-rw-r--r--chip/lm4/flash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/chip/lm4/flash.c b/chip/lm4/flash.c
index c7781c88f1..d2d670c8ef 100644
--- a/chip/lm4/flash.c
+++ b/chip/lm4/flash.c
@@ -63,11 +63,11 @@ static int write_buffer(void)
/* Start write operation at page boundary */
LM4_FLASH_FMC2 = 0xa4420001;
-#ifdef CONFIG_WATCHDOG
- /* Reload the watchdog timer, so that writing a large amount of flash
- * doesn't cause a watchdog reset. */
+ /*
+ * Reload the watchdog timer, so that writing a large amount of flash
+ * doesn't cause a watchdog reset.
+ */
watchdog_reload();
-#endif
/* Wait for write to complete */
for (t = 0; LM4_FLASH_FMC2 & 0x01; t += 10) {
@@ -138,12 +138,12 @@ int flash_physical_erase(int offset, int size)
LM4_FLASH_FMA = offset;
-#ifdef CONFIG_WATCHDOG
- /* Reload the watchdog timer, so that erasing many flash pages
+ /*
+ * Reload the watchdog timer, so that erasing many flash pages
* doesn't cause a watchdog reset. May not need this now that
- * we're using msleep() below. */
+ * we're using msleep() below.
+ */
watchdog_reload();
-#endif
/* Start erase */
LM4_FLASH_FMC = 0xa4420002;