[PATCH v2 4/6] staging: fbtft: propagate error code from kstrto*()

From: Andy Shevchenko
Date: Mon Jan 02 2017 - 06:36:24 EST


kstrto*() functions return proper error code.

Do propogate it to the user.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/staging/fbtft/fbtft-sysfs.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
index 8d8bd12b90a1..7ec5330a292f 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
@@ -14,11 +14,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,
--
2.11.0