platform/x86: asus-wmi: Refactor charge_threshold_store()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 09:46:25 +0000 (12:46 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 09:50:12 +0000 (12:50 +0300)
commit84d8e80b0a3612aad746837e95d8efe324fdc5c6
treef8245b33eef3d191c153ae13ca7e2b6214eea03d
parentd507a54f5865d8dcbdd16c66a1a2da15640878ca
platform/x86: asus-wmi: Refactor charge_threshold_store()

There are few issues with the current code:
 - the error code from kstrtouint() is shadowed
 - the error code from asus_wmi_set_devstate() is ignored
 - the extra check against 0 for count (this is guaranteed by sysfs)

Fix these issues by doing a slight refactoring of charge_threshold_store().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c