OSDN Git Service

Simplify property_get to property_get_bool android-x86-7.1-r1 android-x86-7.1-r2 android-x86-8.1-r1
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 23 May 2017 02:02:48 +0000 (10:02 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 23 May 2017 02:02:48 +0000 (10:02 +0800)
power.c

diff --git a/power.c b/power.c
index bba06fc..cd284d5 100644 (file)
--- a/power.c
+++ b/power.c
@@ -57,7 +57,7 @@ static void power_init(struct power_module *module UNUSED)
 static void power_set_interactive(struct power_module *module UNUSED, int on)
 {
     char mod[PROPERTY_VALUE_MAX];
-    if ((!property_get("wlan.no-unload-driver", mod, NULL) || strcmp(mod, "1"))
+    if (!property_get_bool("wlan.no-unload-driver", 0)
             && property_get("wlan.modname", mod, NULL)) {
         if (on) {
             if (insmod_by_dep(mod, "", NULL, 0, NULL)) {