halapi: common: Fix bug by using the module parameter 89/251089/1
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 8 Jan 2021 03:30:03 +0000 (12:30 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 8 Jan 2021 03:32:49 +0000 (12:32 +0900)
hal-api-common helper functions have been used the fixed hal module id
such as HAL_MODULE_FOO. It is wrong usage. hal-api-common helper
functions have to use the 'module' parameter.

Change-Id: Ifa27e0e4df3c5b89ce96511802ef5a008cf2a279
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-api-common.c

index 9be72fa..9f47636 100644 (file)
@@ -80,7 +80,7 @@ int hal_common_get_backend(enum hal_module module, void **data)
        int ret = 0;
 
        /* Load module */
-       library_name = hal_common_get_backend_library_name(HAL_MODULE_FOO);
+       library_name = hal_common_get_backend_library_name(module);
        if (!library_name) {
                _E("Failed to get backend library name of %s\n",
                                hal_module_info[module].module_name);
@@ -93,7 +93,7 @@ int hal_common_get_backend(enum hal_module module, void **data)
                return TIZEN_ERROR_INVALID_PARAMETER;
        }
 
-       symbol_name = hal_common_get_backend_symbol_name(HAL_MODULE_FOO);
+       symbol_name = hal_common_get_backend_symbol_name(module);
        if (!symbol_name) {
                _E("Failed to get backend symbol name of %s\n",
                                hal_module_info[module].module_name);
@@ -111,8 +111,7 @@ int hal_common_get_backend(enum hal_module module, void **data)
        /* Print backend module and vendor name */
 
        /* Check HAL ABI Version */
-       ret = hal_common_check_backend_abi_version(HAL_MODULE_FOO,
-                                          backend->abi_version);
+       ret = hal_common_check_backend_abi_version(module, backend->abi_version);
        if (ret < 0) {
                _E("Failed to check ABI version of %s\n",
                                hal_module_info[module].module_name);