This commit fixes the "simple_strtoul is obsolete, use kstrtoul instead"
checkpatch warning.

Signed-off-by: Konrad Zapalowicz <bergo.tor...@gmail.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c 
b/drivers/platform/x86/thinkpad_acpi.c
index 8631981..9456e3f 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1067,14 +1067,16 @@ static void delete_attr_set(struct attribute_set *s, 
struct kobject *kobj)
 static int parse_strtoul(const char *buf,
                unsigned long max, unsigned long *value)
 {
-       char *endp;
+       int error = 0;
 
-       *value = simple_strtoul(skip_spaces(buf), &endp, 0);
-       endp = skip_spaces(endp);
-       if (*endp || *value > max)
-               return -EINVAL;
+       error = kstrtoul(skip_spaces(buf), 0, &(*value));
+       if (error)
+               goto out;
 
-       return 0;
+       if (*value > max)
+               error = -EINVAL;
+out:
+       return error;
 }
 
 static void tpacpi_disable_brightness_delay(void)
-- 
1.8.1.2


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

Reply via email to