From: Youngjae Cho Date: Thu, 16 Jun 2022 03:59:54 +0000 (+0900) Subject: power: move #include into a source code X-Git-Tag: accepted/tizen/unified/20220626.224822~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F276397%2F1;p=platform%2Fcore%2Fapi%2Fdevice.git 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 --- 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); +}