]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: fbtft: propagate error code from kstrto*()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 19 Jan 2017 10:45:43 +0000 (12:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 11:50:27 +0000 (12:50 +0100)
kstrto*() functions return proper error code.

Do propogate it to the user.

Acked-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-sysfs.c

index 8d8bd12b90a1d33bcc97fb7f4f6dc3d869078da6..5922f1b6d8d66599642a8409d8989a7fde44ea47 100644 (file)
@@ -4,7 +4,6 @@
 static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
 {
        char *p_val;
-       int ret;
 
        if (!str_p || !(*str_p))
                return -EINVAL;
@@ -14,11 +13,7 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base)
        if (!p_val)
                return -EINVAL;
 
-       ret = kstrtoul(p_val, base, val);
-       if (ret)
-               return -EINVAL;
-
-       return 0;
+       return kstrtoul(p_val, base, val);
 }
 
 int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves,