Commit 07779c33 authored by Dan Carpenter's avatar Dan Carpenter Committed by Andy Shevchenko

platform/x86: asus-wmi: Fix condition in charge_threshold_store()

This error handling is reversed so we return early.

Fixes: 84d8e80b ("platform/x86: asus-wmi: Refactor charge_threshold_store()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 109e8adf
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment