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 <y0.cho@samsung.com>
* @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.
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;