From 0f653b51e29c6b550036761cfc30710b11dd757a Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Mon, 8 Jul 2024 17:00:11 +0900 Subject: [PATCH] haptic: Modify return value check properly If there is no vibration backend(device), hal-api-device returns -ENODEV through feedbackd. However, that value goes to dbus getter variable not the return value of dbus call. Thus, the return check code has been modified as intended. Change-Id: If47d60bce6eadb0c9a09e2cbfc84d22f0a727ab6 Signed-off-by: Yunhee Seo --- src/haptic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/haptic.c b/src/haptic.c index ce613bc..96782d6 100644 --- a/src/haptic.c +++ b/src/haptic.c @@ -90,10 +90,10 @@ int device_haptic_get_count(int *device_number) METHOD_GET_COUNT, NULL, &val); /** * there is no haptic method in no vibration model. - * so -ENOTSUP means that haptic count is zero. + * so -ENODEV means that haptic count is zero. */ - if (ret_val == -ENOTSUP) - ret_val = 0; + if (val == -ENODEV) + val = 0; else if (ret_val < 0) return errno_to_device_error(ret_val); //LCOV_EXCL_LINE System Error -- 2.7.4