x86/early_printk: Replace obsolete simple_strtoul() usage with kstrtoint()
authorShuah Khan <shuahkhan@gmail.com>
Thu, 31 May 2012 00:40:03 +0000 (18:40 -0600)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 Jun 2012 09:44:22 +0000 (11:44 +0200)
Change early_serial_init() to call kstrtoul() instead of calling
obsoleted simple_strtoul().

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Cc: Joe Perches <joe@perches.com>
Link: http://lkml.kernel.org/r/1338424803.3569.5.camel@lorien2
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/early_printk.c

index 9b9f18b4991849f7cc1923441bea2d5f5359886c..5e4771266f1a966e8c7cde35ab694ec551c61e7d 100644 (file)
@@ -119,7 +119,7 @@ static __init void early_serial_init(char *s)
        unsigned char c;
        unsigned divisor;
        unsigned baud = DEFAULT_BAUD;
-       char *e;
+       ssize_t ret;
 
        if (*s == ',')
                ++s;
@@ -127,14 +127,14 @@ static __init void early_serial_init(char *s)
        if (*s) {
                unsigned port;
                if (!strncmp(s, "0x", 2)) {
-                       early_serial_base = simple_strtoul(s, &e, 16);
+                       ret = kstrtoint(s, 16, &early_serial_base);
                } else {
                        static const int __initconst bases[] = { 0x3f8, 0x2f8 };
 
                        if (!strncmp(s, "ttyS", 4))
                                s += 4;
-                       port = simple_strtoul(s, &e, 10);
-                       if (port > 1 || s == e)
+                       ret = kstrtouint(s, 10, &port);
+                       if (ret || port > 1)
                                port = 0;
                        early_serial_base = bases[port];
                }
@@ -149,8 +149,8 @@ static __init void early_serial_init(char *s)
        outb(0x3, early_serial_base + MCR);     /* DTR + RTS */
 
        if (*s) {
-               baud = simple_strtoul(s, &e, 0);
-               if (baud == 0 || s == e)
+               ret = kstrtouint(s, 0, &baud);
+               if (ret || baud == 0)
                        baud = DEFAULT_BAUD;
        }