summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-09-02 17:38:50 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-09-07 19:50:05 +0300
commit07779c33a7282366f979e384de263e42aa422ada (patch)
treed868b099b67cb3c8184afe48269a311a174424b2 /drivers/platform
parent109e8adfbc665a3e463043cefd5d17e552dc020c (diff)
downloadlinux-07779c33a7282366f979e384de263e42aa422ada.tar.bz2
platform/x86: asus-wmi: Fix condition in charge_threshold_store()
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 14467748b343..848b23764fc3 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -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)