From: Youngjae Cho Date: Wed, 26 Mar 2025 03:35:48 +0000 (+0900) Subject: halcc: Return -ENOENT on backend loading failure when getting transport X-Git-Tag: accepted/tizen/unified/20250404.074540~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f8b29d73c42bd66d9e94145ab5ae9d0a4bf394d;p=platform%2Fhal%2Fapi%2Fcommon.git halcc: Return -ENOENT on backend loading failure when getting transport It has changed that the hal_common_get_transport() now distinguishes those two case below using return value. 1. Failure due to version mismatch or not supported transport -> Return value: -ELIBBAD 2. Failure due to error related to loading backend library -> Return value: -ENOENT The first one is the case that it succeeded to load backend library, but version of the library wasn't matched to the platform manifest. On the other hand, the second case fails to load backend library itself, for example, there is no installed backend library for a module. Change-Id: I4b96da46625abe72365ab2c58533780bdfac8452 Signed-off-by: Youngjae Cho --- diff --git a/include/hal-common.h b/include/hal-common.h index 7b3bf88..0a37294 100644 --- a/include/hal-common.h +++ b/include/hal-common.h @@ -345,6 +345,8 @@ int hal_common_get_supported_interface_versions(enum hal_module module, * @param[in] module HAL id among enum hal_module * @param[out] transport The transport of version that matching to the hal backend installed * @return @c 0 on success, otherwise a negative error value + * @retval -ELIBBAD Incompatible backend version with platform manifest + * @retval -ENOENT No backend library installed or no valid data symbol found * @code * // If a module manifest has specified transport like below, and the underlying * // backend is version of 2.0, then it returns HAL_COMMON_TRANSPORT_PASSTHROUGH. diff --git a/src/hal-api-compatibility-checker.c b/src/hal-api-compatibility-checker.c index 837b96f..4ca8e74 100644 --- a/src/hal-api-compatibility-checker.c +++ b/src/hal-api-compatibility-checker.c @@ -545,7 +545,9 @@ int hal_api_cc_get_transport(enum hal_module module, enum hal_common_transport * return ret; } - if (info.compatibility != HAL_COMMON_BACKEND_COMPATIBILITY_COMPATIBLE) + if (info.compatibility == HAL_COMMON_BACKEND_COMPATIBILITY_UNKNOWN) + return -ENOENT; + else if (info.compatibility == HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE) return -ELIBBAD; *transport = info.compatible_transport;