platform/x86: asus-wmi: Fix condition in charge_threshold_store()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 2 Sep 2019 14:38:50 +0000 (17:38 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 7 Sep 2019 16:50:05 +0000 (19:50 +0300)
This error handling is reversed so we return early.

Fixes: 84d8e80b0a36 ("platform/x86: asus-wmi: Refactor charge_threshold_store()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c

index 1446774..848b237 100644 (file)
@@ -2068,7 +2068,7 @@ static ssize_t charge_threshold_store(struct device *dev,
                return -EINVAL;
 
        ret = asus_wmi_set_devstate(ASUS_WMI_CHARGE_THRESHOLD, value, &rv);
-       if (!ret)
+       if (ret)
                return ret;
 
        if (rv != 1)