diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-03-23 12:45:28 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-18 17:32:40 -0700 |
commit | 068cd0850684ee28a5a514e5a270edce2edb3979 (patch) | |
tree | e84f2316e37baa72f1c9611e665749d91a3ce8fd /board/glados/board.c | |
parent | 1e7c280491232110e1006d545f9a61ca05d469d5 (diff) | |
download | chrome-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/glados/board.c')
-rw-r--r-- | board/glados/board.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/board/glados/board.c b/board/glados/board.c index 08ed832fa6..8855ae9518 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -88,10 +88,11 @@ void usb1_evt(enum gpio_signal signal) * state of GPIOs, so its definition must reside after including gpio_list. */ static void enable_input_devices(void); +DECLARE_DEFERRED(enable_input_devices); void tablet_mode_interrupt(enum gpio_signal signal) { - hook_call_deferred(enable_input_devices, 0); + hook_call_deferred(&enable_input_devices_data, 0); } #include "gpio_list.h" @@ -380,14 +381,13 @@ static void enable_input_devices(void) keyboard_scan_enable(kb_enable, KB_SCAN_DISABLE_LID_ANGLE); gpio_set_level(GPIO_ENABLE_TOUCHPAD, tp_enable); } -DECLARE_DEFERRED(enable_input_devices); /* Called on AP S5 -> S3 transition */ static void board_chipset_startup(void) { gpio_set_level(GPIO_USB1_ENABLE, 1); gpio_set_level(GPIO_USB2_ENABLE, 1); - hook_call_deferred(enable_input_devices, 0); + hook_call_deferred(&enable_input_devices_data, 0); } DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT); @@ -396,7 +396,7 @@ static void board_chipset_shutdown(void) { gpio_set_level(GPIO_USB1_ENABLE, 0); gpio_set_level(GPIO_USB2_ENABLE, 0); - hook_call_deferred(enable_input_devices, 0); + hook_call_deferred(&enable_input_devices_data, 0); } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT); |