diff options
author | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 16:35:46 +0900 |
---|---|---|
committer | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 16:37:15 +0900 |
commit | fc3e4b4993398c8aaa21c77182d70f97e4c8454d (patch) | |
tree | 0894c65d94fa626eda9d2e7e87ebe34e526adb95 | |
parent | 1e519193b65205ff66fcd340a7ad3b66997d4ec6 (diff) | |
download | nfc-accepted/tizen_unified_x.tar.gz nfc-accepted/tizen_unified_x.tar.bz2 nfc-accepted/tizen_unified_x.zip |
Apply multi-hal interfacetizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20240813.225705accepted/tizen/unified/x/20240715.042437accepted/tizen/unified/toolchain/20240812.131420accepted/tizen/unified/dev/20240715.080549accepted/tizen/unified/20240712.160119accepted/tizen/9.0/unified/20241030.232415tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: Ia76e357e4bdf5f98ad32b6e8bf919a34178285cf
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--[-rwxr-xr-x] | src/hal-api-nfc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/hal-api-nfc.c b/src/hal-api-nfc.c index ad25aef..30147cc 100755..100644 --- a/src/hal-api-nfc.c +++ b/src/hal-api-nfc.c @@ -43,10 +43,15 @@ int hal_nfc_get_backend(void) if (g_nfc_funcs) return 0; + g_nfc_funcs = calloc(1, sizeof(hal_backend_nfc_funcs)); + if (!g_nfc_funcs) + return -ENOMEM; + ret = hal_common_get_backend(HAL_MODULE_NFC, (void **)&g_nfc_funcs); if (ret < 0) { - _E("Failed to get backend\n"); - return -EINVAL; + free(g_nfc_funcs); + g_nfc_funcs = NULL; + return -ENOTSUP; } return 0; @@ -55,16 +60,12 @@ int hal_nfc_get_backend(void) EXPORT int hal_nfc_put_backend(void) { - int ret; - if (!g_nfc_funcs) return -EINVAL; - ret = hal_common_put_backend(HAL_MODULE_NFC, (void *)g_nfc_funcs); - if (ret < 0) { - _E("Failed to put backend\n"); - return -EINVAL; - } + hal_common_put_backend(HAL_MODULE_NFC, (void *)g_nfc_funcs); + + free(g_nfc_funcs); g_nfc_funcs = NULL; return 0; |