]> Git Repo - linux.git/commitdiff
platform/x86: intel_pmc_ipc: Propagate error from kstrtoul()
authorMika Westerberg <[email protected]>
Wed, 22 Jan 2020 16:46:18 +0000 (19:46 +0300)
committerAndy Shevchenko <[email protected]>
Wed, 22 Jan 2020 16:52:27 +0000 (18:52 +0200)
kstrtoul() already returns negative error if the input was not valid so
return it directly.

Signed-off-by: Mika Westerberg <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
drivers/platform/x86/intel_pmc_ipc.c

index b87036089a541358a4d5f696f69fe31780595809..7b180ead064af0e090353480296109fd484a1b4f 100644 (file)
@@ -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;
This page took 0.058682 seconds and 4 git commands to generate.