summaryrefslogtreecommitdiff
path: root/chip/lm4/flash.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-26 14:31:47 -0700
committerGerrit <chrome-bot@google.com>2012-10-29 16:52:49 -0700
commit1d916d7c6b25de10c870cf7f35a44d3654d9f099 (patch)
tree5d7337654d86766324103217ab61ae0b71d65e0f /chip/lm4/flash.c
parent67aadcf614513353d7c9a0216fc70f7af18d8d05 (diff)
downloadchrome-ec-1d916d7c6b25de10c870cf7f35a44d3654d9f099.tar.gz
Use SECOND and MSEC constants
We'd defined them in a number of different files. This moves definitions to timer.h, and uses them everywhere we have large delays (since 10*SECOND is less typo-prone than 10000000). Also add msleep() and sleep() inline functions. No need for mdelay() or delay(), since any delays that long should use sleep funcs instead of spin-waiting. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; taskinfo displays similar numbers to before Change-Id: I2a92a9f10f46b6b7b6571759b1f8ab4ecfbf8259 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36726
Diffstat (limited to 'chip/lm4/flash.c')
-rw-r--r--chip/lm4/flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/lm4/flash.c b/chip/lm4/flash.c
index 8a9c3dc946..e06246b7ee 100644
--- a/chip/lm4/flash.c
+++ b/chip/lm4/flash.c
@@ -243,7 +243,7 @@ int flash_physical_erase(int offset, int size)
#ifdef CONFIG_TASK_WATCHDOG
/* 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 usleep() below. */
+ * we're using msleep() below. */
watchdog_reload();
#endif
@@ -254,7 +254,7 @@ int flash_physical_erase(int offset, int size)
for (t = 0; LM4_FLASH_FMC & 0x02; t++) {
if (t > ERASE_TIMEOUT_MS)
return EC_ERROR_TIMEOUT;
- usleep(1000);
+ msleep(1);
}
/* Check for error conditions - erase failed, voltage error,