Merge "audio-hal: gef: Remove access check for gef library"
This commit is contained in:
commit
a1f1cd8615
|
@ -109,69 +109,63 @@ static acdb_device_type make_acdb_device_type_from_gef_cal_type
|
||||||
|
|
||||||
void audio_extn_gef_init(struct audio_device *adev)
|
void audio_extn_gef_init(struct audio_device *adev)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
const char* error = NULL;
|
const char* error = NULL;
|
||||||
|
|
||||||
ALOGV("%s: Enter with error", __func__);
|
ALOGV("%s: Enter with error", __func__);
|
||||||
|
|
||||||
memset(&gef_hal_handle, 0, sizeof(gef_data));
|
memset(&gef_hal_handle, 0, sizeof(gef_data));
|
||||||
|
|
||||||
ret = access(GEF_LIBRARY, R_OK);
|
//: check error for dlopen
|
||||||
if (ret == 0) {
|
gef_hal_handle.handle = dlopen(GEF_LIBRARY, RTLD_LAZY);
|
||||||
//: check error for dlopen
|
if (gef_hal_handle.handle == NULL) {
|
||||||
gef_hal_handle.handle = dlopen(GEF_LIBRARY, RTLD_LAZY);
|
ALOGE("%s: DLOPEN failed for %s with error %s",
|
||||||
if (gef_hal_handle.handle == NULL) {
|
__func__, GEF_LIBRARY, dlerror());
|
||||||
ALOGE("%s: DLOPEN failed for %s with error %s",
|
goto ERROR_RETURN;
|
||||||
__func__, GEF_LIBRARY, dlerror());
|
|
||||||
goto ERROR_RETURN;
|
|
||||||
} else {
|
|
||||||
ALOGV("%s: DLOPEN successful for %s", __func__, GEF_LIBRARY);
|
|
||||||
|
|
||||||
//call dlerror to clear the error
|
|
||||||
dlerror();
|
|
||||||
gef_hal_handle.init =
|
|
||||||
(gef_init_t)dlsym(gef_hal_handle.handle, "gef_init");
|
|
||||||
error = dlerror();
|
|
||||||
|
|
||||||
if(error != NULL) {
|
|
||||||
ALOGE("%s: dlsym of %s failed with error %s",
|
|
||||||
__func__, "gef_init", error);
|
|
||||||
goto ERROR_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
//call dlerror to clear the error
|
|
||||||
dlerror();
|
|
||||||
gef_hal_handle.deinit =
|
|
||||||
(gef_deinit_t)dlsym(gef_hal_handle.handle, "gef_deinit");
|
|
||||||
error = dlerror();
|
|
||||||
|
|
||||||
if(error != NULL) {
|
|
||||||
ALOGE("%s: dlsym of %s failed with error %s",
|
|
||||||
__func__, "gef_deinit", error);
|
|
||||||
goto ERROR_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
//call dlerror to clear the error
|
|
||||||
error = dlerror();
|
|
||||||
gef_hal_handle.device_config_cb =
|
|
||||||
(gef_device_config_cb_t)dlsym(gef_hal_handle.handle,
|
|
||||||
"gef_device_config_cb");
|
|
||||||
error = dlerror();
|
|
||||||
|
|
||||||
if(error != NULL) {
|
|
||||||
ALOGE("%s: dlsym of %s failed with error %s",
|
|
||||||
__func__, "gef_device_config_cb", error);
|
|
||||||
goto ERROR_RETURN;
|
|
||||||
}
|
|
||||||
|
|
||||||
gef_hal_handle.gef_ptr = gef_hal_handle.init((void*)adev);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ALOGE("%s: %s access failed", __func__, GEF_LIBRARY);
|
ALOGV("%s: DLOPEN successful for %s", __func__, GEF_LIBRARY);
|
||||||
|
|
||||||
|
//call dlerror to clear the error
|
||||||
|
dlerror();
|
||||||
|
gef_hal_handle.init =
|
||||||
|
(gef_init_t)dlsym(gef_hal_handle.handle, "gef_init");
|
||||||
|
error = dlerror();
|
||||||
|
|
||||||
|
if(error != NULL) {
|
||||||
|
ALOGE("%s: dlsym of %s failed with error %s",
|
||||||
|
__func__, "gef_init", error);
|
||||||
|
goto ERROR_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
//call dlerror to clear the error
|
||||||
|
dlerror();
|
||||||
|
gef_hal_handle.deinit =
|
||||||
|
(gef_deinit_t)dlsym(gef_hal_handle.handle, "gef_deinit");
|
||||||
|
error = dlerror();
|
||||||
|
|
||||||
|
if(error != NULL) {
|
||||||
|
ALOGE("%s: dlsym of %s failed with error %s",
|
||||||
|
__func__, "gef_deinit", error);
|
||||||
|
goto ERROR_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
//call dlerror to clear the error
|
||||||
|
error = dlerror();
|
||||||
|
gef_hal_handle.device_config_cb =
|
||||||
|
(gef_device_config_cb_t)dlsym(gef_hal_handle.handle,
|
||||||
|
"gef_device_config_cb");
|
||||||
|
error = dlerror();
|
||||||
|
|
||||||
|
if(error != NULL) {
|
||||||
|
ALOGE("%s: dlsym of %s failed with error %s",
|
||||||
|
__func__, "gef_device_config_cb", error);
|
||||||
|
goto ERROR_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
gef_hal_handle.gef_ptr = gef_hal_handle.init((void*)adev);
|
||||||
}
|
}
|
||||||
|
|
||||||
ERROR_RETURN:
|
ERROR_RETURN:
|
||||||
ALOGV("%s: Exit with error %d", __func__, ret);
|
ALOGV("%s: Exit with error ", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue