pass: hal: Permit zero value for setting dvfs data 98/138798/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Thu, 13 Jul 2017 04:10:05 +0000 (13:10 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 14 Jul 2017 00:41:28 +0000 (09:41 +0900)
Now several set-functions cannot take zero for target value. However,
zero is acceptable value whether it is reasonable or not. Thus, zero
is permitted for function parameter, and functions will only reject
negative value.

Change-Id: Ic363abc239ab521577165768f1e41a61e502f4c3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/pass/pass-hal.c

index 86c3fcbd3aabed4a896aef4fe177588a4c029e4f..a68739935b6f462ab19a4f5e1dd39e4d4b121400 100644 (file)
@@ -182,7 +182,7 @@ int pass_set_min_freq(struct pass_resource *res, int freq)
        char *res_name;
        int res_type;
 
-       if (!res || freq <= 0)
+       if (!res || freq < 0)
                return -EINVAL;
 
        res_name = res->cdata.res_name;
@@ -226,7 +226,7 @@ int pass_set_max_freq(struct pass_resource *res, int freq)
        char *res_name;
        int res_type;
 
-       if (!res || freq <= 0)
+       if (!res || freq < 0)
                return -EINVAL;
 
        res_name = res->cdata.res_name;
@@ -271,7 +271,7 @@ int pass_set_up_threshold(struct pass_resource *res, int up_threshold)
        char *res_name;
        int res_type;
 
-       if (!res || up_threshold <= 0)
+       if (!res || up_threshold < 0)
                return -EINVAL;
 
        res_name = res->cdata.res_name;