platform/x86: asus-wmi: Fix condition in charge_threshold_store()
PATCH 1/1 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 <[email protected]>
--- drivers/platform/x86/asus-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +1 -1
@@ -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 )
Signature · 1 line
2.20.1
Quoted 3 lines · Dan Carpenter
This error handling is reversed so we return early.
I will squash to the original commit since it's not yet upstream.
Are you okay with this?
Quoted 22 lines
Fixes 84d8e80b0a36 ("platform/x86: asus-wmi: Refactor charge_threshold_store()")Signed-off-by Dan Carpenter <[email protected]>--- drivers/platform/x86/asus-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/asus-wmi.c +1
-2@@ -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.20.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 3 lines · Dan Carpenter
This error handling is reversed so we return early.
I will squash to the original commit since it's not yet upstream.
Are you okay with this?
Sure. That's fine.
regards,
dan carpenter