haptic: Modify return value check properly 89/314189/1 accepted/tizen/unified/20240711.011500 accepted/tizen/unified/dev/20240711.085733 accepted/tizen/unified/x/20240711.084602
authorYunhee Seo <yuni.seo@samsung.com>
Mon, 8 Jul 2024 08:00:11 +0000 (17:00 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Mon, 8 Jul 2024 08:00:11 +0000 (17:00 +0900)
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 <yuni.seo@samsung.com>
src/haptic.c

index ce613bc..96782d6 100644 (file)
@@ -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