Drop warning log for getting transport if hal-backend is not supported 45/321645/2
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 26 Mar 2025 04:11:59 +0000 (13:11 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 26 Mar 2025 06:12:50 +0000 (15:12 +0900)
The hal_common_get_transport() returns -ENOENT if it fails to load
backend library, for example, due to the library hasn't been installed
on the image. This might happen as a product image could not fully
supports all the hal backends and this could spam the log. Therefore,
do not print log in this case.

Change-Id: I93be7243999420e864b839ae1bc85f2cdbdc73d5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/hal-api-device-battery.c
src/hal-api-device-display.c
src/hal-api-device-led.c

index 8c3e3042e28bbd796b254ee6156a7292b865f2d8..35bdce5d5cadc836819e50c616a6b03c350be88c 100644 (file)
@@ -29,7 +29,8 @@ static void __attribute__((constructor)) hal_device_battery_constructor(void)
        int ret = hal_common_get_transport(HAL_MODULE_DEVICE_BATTERY,
                                                &g_hal_transport);
        if (ret < 0) {
-               _W("Failed to get HAL transport from HAL manifest\n");
+               if (ret != -ENOENT)
+                       _W("Failed to get HAL transport from HAL manifest\n");
                g_hal_transport = HAL_COMMON_TRANSPORT_PASSTHROUGH;
        }
 }
index e6884346293903e59c65fbcf812439ddc45fb5d6..1db48685fd703341d6df3e11db8f8507ed11f250 100644 (file)
@@ -31,7 +31,8 @@ static void __attribute__((constructor)) hal_device_display_constructor(void)
        int ret = hal_common_get_transport(HAL_MODULE_DEVICE_DISPLAY,
                                                &g_hal_transport);
        if (ret < 0) {
-               _W("Failed to get HAL transport from HAL manifest\n");
+               if (ret != -ENOENT)
+                       _W("Failed to get HAL transport from HAL manifest\n");
                g_hal_transport = HAL_COMMON_TRANSPORT_PASSTHROUGH;
        }
 }
index 43b286728d2dce4509964facca3513a7a7f18197..8262abaf128e7da6d0f5600064bb497adac10255 100644 (file)
@@ -29,7 +29,8 @@ static void __attribute__((constructor)) hal_device_led_constructor(void)
        int ret = hal_common_get_transport(HAL_MODULE_DEVICE_LED,
                                                &g_hal_transport);
        if (ret < 0) {
-               _W("Failed to get HAL transport from HAL manifest\n");
+               if (ret != -ENOENT)
+                       _W("Failed to get HAL transport from HAL manifest\n");
                g_hal_transport = HAL_COMMON_TRANSPORT_PASSTHROUGH;
        }
 }