summaryrefslogtreecommitdiff
path: root/chip/mec1322
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 /chip/mec1322
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 'chip/mec1322')
-rw-r--r--chip/mec1322/clock.c6
-rw-r--r--chip/mec1322/lpc.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c
index 8a5fb73047..6a1674891e 100644
--- a/chip/mec1322/clock.c
+++ b/chip/mec1322/clock.c
@@ -80,18 +80,20 @@ void clock_init(void)
* Speed through boot + vboot hash calculation, dropping our processor clock
* only after vboot hashing is completed.
*/
+static void clock_turbo_disable(void);
+DECLARE_DEFERRED(clock_turbo_disable);
+
static void clock_turbo_disable(void)
{
#ifdef CONFIG_VBOOT_HASH
if (vboot_hash_in_progress())
- hook_call_deferred(clock_turbo_disable, 100 * MSEC);
+ hook_call_deferred(&clock_turbo_disable_data, 100 * MSEC);
else
#endif
/* Use 12 MHz processor clock for power savings */
MEC1322_PCR_PROC_CLK_CTL = 4;
}
DECLARE_HOOK(HOOK_INIT, clock_turbo_disable, HOOK_PRIO_INIT_VBOOT_HASH + 1);
-DECLARE_DEFERRED(clock_turbo_disable);
#ifdef CONFIG_LOW_POWER_IDLE
/**
diff --git a/chip/mec1322/lpc.c b/chip/mec1322/lpc.c
index c97b74760c..df40f563a9 100644
--- a/chip/mec1322/lpc.c
+++ b/chip/mec1322/lpc.c
@@ -357,7 +357,7 @@ void girq19_interrupt(void)
#ifdef CONFIG_CHIPSET_RESET_HOOK
/* Notify HOOK_CHIPSET_RESET */
- hook_call_deferred(lpc_chipset_reset, MSEC);
+ hook_call_deferred(&lpc_chipset_reset_data, MSEC);
#endif
}