From 355b5f6abccd7ec168bbf7d19e68126947b9ab73 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Thu, 16 Jun 2022 12:59:54 +0900 Subject: [PATCH] power: move #include into a source code A header can be used by other packages and their environment variable for locating header files cannot locate hal/device/hal-board.h, which makes No such file or directory error. To address this, hide the include into source code and only exposes declaration through header. Change-Id: I3f5c310dcf8f5fa1306fe2551d15d86caf68ba4d Signed-off-by: Youngjae Cho --- include/power-internal.h | 11 +---------- src/power-internal.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/power-internal.h b/include/power-internal.h index 6647d8a..d3653c0 100644 --- a/include/power-internal.h +++ b/include/power-internal.h @@ -25,8 +25,6 @@ extern "C" { #include #include -#include - #include "device-error.h" /** @@ -134,14 +132,7 @@ int device_power_change_state(uint64_t state, int timeout_sec, change_state_call /** * Return 0 if cloning partition is in progress. */ -static inline int device_power_check_reboot_allowed(void) -{ - int retval, cloned; - - retval = hal_device_board_get_partition_ab_cloned(&cloned); - - return (retval != 0 || cloned != 0); -} +int device_power_check_reboot_allowed(void); #ifdef __cplusplus } diff --git a/src/power-internal.c b/src/power-internal.c index 90d18b1..fe72dfc 100644 --- a/src/power-internal.c +++ b/src/power-internal.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "power-internal.h" #include "common.h" @@ -305,3 +306,12 @@ int device_power_change_state(uint64_t state, int timeout_sec, change_state_call return DEVICE_ERROR_NONE; } + +int device_power_check_reboot_allowed(void) +{ + int retval, cloned; + + retval = hal_device_board_get_partition_ab_cloned(&cloned); + + return (retval != 0 || cloned != 0); +} -- 2.7.4