From 07779c33a7282366f979e384de263e42aa422ada Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 2 Sep 2019 17:38:50 +0300 Subject: [PATCH] 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 Signed-off-by: Andy Shevchenko --- drivers/platform/x86/asus-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 1446774..848b237 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) -- 2.7.4