diff options
author | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 17:02:35 +0900 |
---|---|---|
committer | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 17:03:03 +0900 |
commit | d91c9d8a05036f0b8c0e6a7b07722bd86b9f9d77 (patch) | |
tree | 1d7c8df4ed4d3990a62feac237c8cde463f5e7ec | |
parent | d0904f22ec0c5bf98442062ee6eab4e7397ffd80 (diff) | |
download | uwb-accepted/tizen_unified_x.tar.gz uwb-accepted/tizen_unified_x.tar.bz2 uwb-accepted/tizen_unified_x.zip |
Apply multi-hal interfacetizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20240813.230521accepted/tizen/unified/x/20240715.042443accepted/tizen/unified/toolchain/20240812.132235accepted/tizen/unified/dev/20240715.080552accepted/tizen/unified/20240712.160128accepted/tizen/9.0/unified/20241030.233754tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: I2553dfc2e8daec1e12986ba0eb0a9307c4c73007
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--[-rwxr-xr-x] | src/hal-api-uwb.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/hal-api-uwb.c b/src/hal-api-uwb.c index b2c3b06..e045d93 100755..100644 --- a/src/hal-api-uwb.c +++ b/src/hal-api-uwb.c @@ -43,10 +43,15 @@ int hal_uwb_get_backend(void) if (g_uwb_funcs) return 0; + g_uwb_funcs = calloc(1, sizeof(hal_backend_uwb_funcs)); + if (!g_uwb_funcs) + return -ENOMEM; + ret = hal_common_get_backend(HAL_MODULE_UWB, (void **)&g_uwb_funcs); if (ret < 0) { - _E("Failed to get backend\n"); - return -EINVAL; + free(g_uwb_funcs); + g_uwb_funcs = NULL; + return -ENOTSUP; } return 0; @@ -55,16 +60,12 @@ int hal_uwb_get_backend(void) EXPORT int hal_uwb_put_backend(void) { - int ret; - if (!g_uwb_funcs) return -EINVAL; - ret = hal_common_put_backend(HAL_MODULE_UWB, (void *)g_uwb_funcs); - if (ret < 0) { - _E("Failed to put backend\n"); - return -EINVAL; - } + hal_common_put_backend(HAL_MODULE_UWB, (void *)g_uwb_funcs); + + free(g_uwb_funcs); g_uwb_funcs = NULL; return 0; |