If it once fails to get backend version, then all the following
calls for the backend version will fail as well, leaving it
uninitialized. Due to this, the hal-api-common repeatedly try to
initialize it for every call for accessing the backend, which is truely
inefficiet. This is because this kind of failure cannot be recovered
during runtime. Therefore, it is enough to set it as initialized even
when it fails and let the following calls not to take same routine
repeatedly but just immediately return if it has once failed.
Change-Id: I81f6abbadaad9f0cb44849d04135f009127e4dc7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_UNKNOWN;
ret = hal_common_get_backend_version(module, &major, &minor);
if (ret < 0)
- return;
+ goto out;
if (halcc_hal_is_compatible_with_version(hal, major, minor))
info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_COMPATIBLE;
else
info->compatibility = HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE;
+out:
info->initialized = true;
}