summaryrefslogtreecommitdiff
path: root/board/samus/extpower.c
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2016-03-23 12:45:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-04-18 17:32:40 -0700
commit068cd0850684ee28a5a514e5a270edce2edb3979 (patch)
treee84f2316e37baa72f1c9611e665749d91a3ce8fd /board/samus/extpower.c
parent1e7c280491232110e1006d545f9a61ca05d469d5 (diff)
downloadchrome-ec-068cd0850684ee28a5a514e5a270edce2edb3979.tar.gz
Deferred: Use deferred_data instead of function pointer
Previously calls to hook_call_deferred were passed the function to call, which was then looked up in the .rodata.deferred section with a linear search. This linear search can be replaced with a subtract by passing the pointer to the deferred_data object created when DECLARE_DEFERRED was invoked. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None CQ-DEPEND=CL:*255812 TEST=make buildall -j Change-Id: I951dd1541302875b102dd086154cf05591694440 Reviewed-on: https://chromium-review.googlesource.com/334315 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/samus/extpower.c')
-rw-r--r--board/samus/extpower.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/board/samus/extpower.c b/board/samus/extpower.c
index b842f7d3ea..e54cb52a80 100644
--- a/board/samus/extpower.c
+++ b/board/samus/extpower.c
@@ -177,7 +177,7 @@ DECLARE_DEFERRED(allow_min_charging);
static void extpower_board_hacks(int extpower, int extpower_prev)
{
/* Cancel deferred attempt to enable max charge request */
- hook_call_deferred(allow_max_request, -1);
+ hook_call_deferred(&allow_max_request_data, -1);
/*
* When AC is detected, delay briefly before allowing PD
@@ -197,7 +197,7 @@ static void extpower_board_hacks(int extpower, int extpower_prev)
if (extpower && !extpower_prev) {
/* AC connected */
charger_disable(0);
- hook_call_deferred(allow_max_request, 500*MSEC);
+ hook_call_deferred(&allow_max_request_data, 500*MSEC);
set_pp5000_in_g3(PP5000_IN_G3_AC, 1);
} else if (extpower && extpower_prev) {
/*
@@ -213,7 +213,7 @@ static void extpower_board_hacks(int extpower, int extpower_prev)
charger_disable(1);
- hook_call_deferred(allow_min_charging, 100*MSEC);
+ hook_call_deferred(&allow_min_charging_data, 100*MSEC);
set_pp5000_in_g3(PP5000_IN_G3_AC, 0);
}
extpower_prev = extpower;