diff options
author | Shuah Khan <shuahkhan@gmail.com> | 2012-05-30 20:40:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-06-06 05:44:22 -0400 |
commit | fbd24153c48b8425b09c161a020483cd77da870e (patch) | |
tree | 218e215219296ef1dace864cf260d3f26e7c55a6 /arch | |
parent | f841d792e38f75f5e25b0b66f7b5d235d180a735 (diff) |
x86/early_printk: Replace obsolete simple_strtoul() usage with kstrtoint()
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/early_printk.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index 9b9f18b49918..5e4771266f1a 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
@@ -119,7 +119,7 @@ static __init void early_serial_init(char *s) | |||
119 | unsigned char c; | 119 | unsigned char c; |
120 | unsigned divisor; | 120 | unsigned divisor; |
121 | unsigned baud = DEFAULT_BAUD; | 121 | unsigned baud = DEFAULT_BAUD; |
122 | char *e; | 122 | ssize_t ret; |
123 | 123 | ||
124 | if (*s == ',') | 124 | if (*s == ',') |
125 | ++s; | 125 | ++s; |
@@ -127,14 +127,14 @@ static __init void early_serial_init(char *s) | |||
127 | if (*s) { | 127 | if (*s) { |
128 | unsigned port; | 128 | unsigned port; |
129 | if (!strncmp(s, "0x", 2)) { | 129 | if (!strncmp(s, "0x", 2)) { |
130 | early_serial_base = simple_strtoul(s, &e, 16); | 130 | ret = kstrtoint(s, 16, &early_serial_base); |
131 | } else { | 131 | } else { |
132 | static const int __initconst bases[] = { 0x3f8, 0x2f8 }; | 132 | static const int __initconst bases[] = { 0x3f8, 0x2f8 }; |
133 | 133 | ||
134 | if (!strncmp(s, "ttyS", 4)) | 134 | if (!strncmp(s, "ttyS", 4)) |
135 | s += 4; | 135 | s += 4; |
136 | port = simple_strtoul(s, &e, 10); | 136 | ret = kstrtouint(s, 10, &port); |
137 | if (port > 1 || s == e) | 137 | if (ret || port > 1) |
138 | port = 0; | 138 | port = 0; |
139 | early_serial_base = bases[port]; | 139 | early_serial_base = bases[port]; |
140 | } | 140 | } |
@@ -149,8 +149,8 @@ static __init void early_serial_init(char *s) | |||
149 | outb(0x3, early_serial_base + MCR); /* DTR + RTS */ | 149 | outb(0x3, early_serial_base + MCR); /* DTR + RTS */ |
150 | 150 | ||
151 | if (*s) { | 151 | if (*s) { |
152 | baud = simple_strtoul(s, &e, 0); | 152 | ret = kstrtouint(s, 0, &baud); |
153 | if (baud == 0 || s == e) | 153 | if (ret || baud == 0) |
154 | baud = DEFAULT_BAUD; | 154 | baud = DEFAULT_BAUD; |
155 | } | 155 | } |
156 | 156 | ||