summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-29 16:34:02 -0700
committerChromeBot <chrome-bot@google.com>2013-04-02 14:12:55 -0700
commit5966f22a8a1928583943b57fc22e72f85d69d079 (patch)
treee49232c6d5368219faa63cae0ec5e01a4866f837 /common/main.c
parent97bf36c9d3ad3d96ad6dea7cd6e6f3e164297c43 (diff)
downloadchrome-ec-5966f22a8a1928583943b57fc22e72f85d69d079.tar.gz
Add support for calling deferred functions
This is a cleaner way of deferring work from interrupt-time to task-time without requiring a task for each module which needs this. Replaces/supersedes delayed hook notification, which didn't scale well (since every function would have needed to be its own hook type). BUG=chrome-os-partner:18473 BRANCH=none TEST=boot system. plug/unplug AC power; notifies the host properly Change-Id: I50263fe1ce37e74c1ef8db3671379098997102ed Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46953 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/common/main.c b/common/main.c
index cb6b0b8bbb..6ee477931f 100644
--- a/common/main.c
+++ b/common/main.c
@@ -120,12 +120,8 @@ int main(void)
keyboard_scan_init();
#endif
- /*
- * Initialize other driver modules. These can occur in any order.
- * Non-driver modules with tasks do their inits from their task
- * functions, not here.
- */
- hook_notify(HOOK_INIT);
+ /* Initialize the hook library. This calls HOOK_INIT hooks. */
+ hook_init();
/*
* Print the init time. Not completely accurate because it can't take