diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-09-02 17:38:50 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-09-07 19:50:05 +0300 |
commit | 07779c33a7282366f979e384de263e42aa422ada (patch) | |
tree | d868b099b67cb3c8184afe48269a311a174424b2 | |
parent | 109e8adfbc665a3e463043cefd5d17e552dc020c (diff) | |
download | linux-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>
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 2 |
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) |