pass: rescon: Handle -ENOTSUP error instad of -ENODEV 27/252627/2 accepted/tizen/unified/20210204.134448 submit/tizen/20210201.020414 submit/tizen/20210204.032624
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 1 Feb 2021 01:32:35 +0000 (10:32 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 1 Feb 2021 01:58:03 +0000 (10:58 +0900)
The Power HAL API (hal-api-power) uses the -ENOTSUP error when HAL
function is not implemented instead of -ENODEV error. So that
handle -ENOTSUP error instad of -ENODEV

Change-Id: I7637f78d76e2350d95091cf216757b1ce53416e4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-rescon.c

index be4e06daeb7945d9c1c3f65bf372c08e7b5d64b6..cb934e29b58aa2973259f866f29070b0b3698127 100644 (file)
@@ -177,10 +177,10 @@ static int rescon_update(struct pass_resource *res)
                        limit_min_cpu = limit_max_cpu;
 
                ret = pass_hal_set_online_min_num(res, limit_min_cpu);
-               if (ret == -EPERM || ret == -ENODEV) {
+               if (ret == -EPERM || ret == -ENOTSUP) {
                        /*
                         * If -EPERM, function is not supported according to
-                        * h/w resource type. And if -ENODEV, function is not
+                        * h/w resource type. And if -ENOTSUP, function is not
                         * implemented on HAL package. It means that this
                         * function is not necessary on two error case
                         * when calling the HAL functions.
@@ -194,7 +194,7 @@ static int rescon_update(struct pass_resource *res)
                }
 
                ret = pass_hal_set_online_max_num(res, limit_max_cpu);
-               if (ret == -EPERM || ret == -ENODEV) {
+               if (ret == -EPERM || ret == -ENOTSUP) {
                        ;
                } else if (ret < 0) {
                        _W("failed to set the maximum number of cpu(%d) of %s",
@@ -207,7 +207,7 @@ static int rescon_update(struct pass_resource *res)
                        ret = pass_hal_set_online_state(res,
                                                res->config_data.cpu + i,
                                                (i < limit_min_cpu) ? 1 : 0);
-                       if (ret == -EPERM || ret == -ENODEV) {
+                       if (ret == -EPERM || ret == -ENOTSUP) {
                                ;
                        } else if (ret < 0) {
                                _W("failed to turn %s of cpu%d of %s",