From 14d045636d4a6902490b7f9795f19738e90fefe7 Mon Sep 17 00:00:00 2001 From: Denis Brockus Date: Tue, 28 May 2019 09:01:51 -0600 Subject: driver: driver/led/oz554 weak reference cleanup oz554_board_init was prototyped as weak and this made all instances, that included that prototype, weak as well. In order to not lose information from the prototype, default and override functions, I changed to use the override weak marker symbols. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I06fc1324ee05806da8816ca382e77e18196fde68 Signed-off-by: Denis Brockus Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1631582 Reviewed-by: Daisuke Nojiri Reviewed-by: Jack Rosenthal Reviewed-by: Jett Rink --- board/karma/board.c | 2 +- driver/led/oz554.c | 5 +++++ driver/led/oz554.h | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/board/karma/board.c b/board/karma/board.c index f8778ad03e..c66a8d02be 100644 --- a/board/karma/board.c +++ b/board/karma/board.c @@ -10,7 +10,7 @@ #define CPRINTS(format, args...) cprints(CC_I2C, format, ## args) #define CPRINTF(format, args...) cprintf(CC_I2C, format, ## args) -void oz554_board_init(void) +__override void oz554_board_init(void) { int pin_status = 0; diff --git a/driver/led/oz554.c b/driver/led/oz554.c index aa50028420..7ceb6bdfa9 100644 --- a/driver/led/oz554.c +++ b/driver/led/oz554.c @@ -137,3 +137,8 @@ static void init_oz554(void) gpio_enable_interrupt(GPIO_PANEL_BACKLIGHT_EN); } DECLARE_HOOK(HOOK_INIT, init_oz554, HOOK_PRIO_DEFAULT); + + +__overridable void oz554_board_init(void) +{ +} diff --git a/driver/led/oz554.h b/driver/led/oz554.h index 009728ba73..d1d9d9656e 100644 --- a/driver/led/oz554.h +++ b/driver/led/oz554.h @@ -9,8 +9,13 @@ #define __CROS_EC_OZ554_H #include "gpio.h" +#include "common.h" -void oz554_board_init(void) __attribute__((weak)); +/* + * Overridable board initialization. Should be overridden by a board + * specific function if the default is not appropriate + */ +__override_proto void oz554_board_init(void); /** * Update oz554 configuration array (oz554_conf). -- cgit v1.2.1