aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2020-01-22 19:46:18 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-01-22 18:52:27 +0200
commitfc07ac64499702ca217e857e3ef924f30e0506bd (patch)
tree1e74e6ba49a7caf9d4f9d21c6468b92a6f934ab5 /drivers/platform
parentplatform/x86: intel_pmc_ipc: Use octal permissions in sysfs attributes (diff)
downloadlinux-dev-fc07ac64499702ca217e857e3ef924f30e0506bd.tar.xz
linux-dev-fc07ac64499702ca217e857e3ef924f30e0506bd.zip
platform/x86: intel_pmc_ipc: Propagate error from kstrtoul()
kstrtoul() already returns negative error if the input was not valid so return it directly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_pmc_ipc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index b87036089a54..7b180ead064a 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -512,8 +512,9 @@ static ssize_t intel_pmc_ipc_northpeak_store(struct device *dev,
int subcmd;
int ret;
- if (kstrtoul(buf, 0, &val))
- return -EINVAL;
+ ret = kstrtoul(buf, 0, &val);
+ if (ret)
+ return ret;
if (val)
subcmd = 1;