diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-02-08 07:18:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:25 -0500 |
commit | ce2e204f0c55567baa0323df8d327989d7113c66 (patch) | |
tree | fd094bebd322c2fd0df68766e3adc0e76eabd424 /drivers/serial | |
parent | 355d95a1c8aab5c0d54178c1b2269e7425c746ee (diff) |
8250_early: coding style
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250_early.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c index 1f16de719962..38776e8b064b 100644 --- a/drivers/serial/8250_early.c +++ b/drivers/serial/8250_early.c | |||
@@ -82,7 +82,8 @@ static void __init serial_putc(struct uart_port *port, int c) | |||
82 | serial_out(port, UART_TX, c); | 82 | serial_out(port, UART_TX, c); |
83 | } | 83 | } |
84 | 84 | ||
85 | static void __init early_serial8250_write(struct console *console, const char *s, unsigned int count) | 85 | static void __init early_serial8250_write(struct console *console, |
86 | const char *s, unsigned int count) | ||
86 | { | 87 | { |
87 | struct uart_port *port = &early_device.port; | 88 | struct uart_port *port = &early_device.port; |
88 | unsigned int ier; | 89 | unsigned int ier; |
@@ -132,7 +133,8 @@ static void __init init_port(struct early_serial8250_device *device) | |||
132 | serial_out(port, UART_LCR, c & ~UART_LCR_DLAB); | 133 | serial_out(port, UART_LCR, c & ~UART_LCR_DLAB); |
133 | } | 134 | } |
134 | 135 | ||
135 | static int __init parse_options(struct early_serial8250_device *device, char *options) | 136 | static int __init parse_options(struct early_serial8250_device *device, |
137 | char *options) | ||
136 | { | 138 | { |
137 | struct uart_port *port = &device->port; | 139 | struct uart_port *port = &device->port; |
138 | int mmio, length; | 140 | int mmio, length; |
@@ -145,8 +147,10 @@ static int __init parse_options(struct early_serial8250_device *device, char *op | |||
145 | port->iotype = UPIO_MEM; | 147 | port->iotype = UPIO_MEM; |
146 | port->mapbase = simple_strtoul(options + 5, &options, 0); | 148 | port->mapbase = simple_strtoul(options + 5, &options, 0); |
147 | #ifdef CONFIG_FIX_EARLYCON_MEM | 149 | #ifdef CONFIG_FIX_EARLYCON_MEM |
148 | set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, port->mapbase & PAGE_MASK); | 150 | set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, |
149 | port->membase = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); | 151 | port->mapbase & PAGE_MASK); |
152 | port->membase = | ||
153 | (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); | ||
150 | port->membase += port->mapbase & ~PAGE_MASK; | 154 | port->membase += port->mapbase & ~PAGE_MASK; |
151 | #else | 155 | #else |
152 | port->membase = ioremap(port->mapbase, 64); | 156 | port->membase = ioremap(port->mapbase, 64); |
@@ -165,7 +169,8 @@ static int __init parse_options(struct early_serial8250_device *device, char *op | |||
165 | } else | 169 | } else |
166 | return -EINVAL; | 170 | return -EINVAL; |
167 | 171 | ||
168 | if ((options = strchr(options, ','))) { | 172 | options = strchr(options, ','); |
173 | if (options) { | ||
169 | options++; | 174 | options++; |
170 | device->baud = simple_strtoul(options, NULL, 0); | 175 | device->baud = simple_strtoul(options, NULL, 0); |
171 | length = min(strcspn(options, " "), sizeof(device->options)); | 176 | length = min(strcspn(options, " "), sizeof(device->options)); |
@@ -179,7 +184,7 @@ static int __init parse_options(struct early_serial8250_device *device, char *op | |||
179 | printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n", | 184 | printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n", |
180 | mmio ? "MMIO" : "I/O port", | 185 | mmio ? "MMIO" : "I/O port", |
181 | mmio ? (unsigned long long) port->mapbase | 186 | mmio ? (unsigned long long) port->mapbase |
182 | : (unsigned long long) port->iobase, | 187 | : (unsigned long long) port->iobase, |
183 | device->options); | 188 | device->options); |
184 | return 0; | 189 | return 0; |
185 | } | 190 | } |
@@ -199,7 +204,8 @@ static int __init early_serial8250_setup(char *options) | |||
199 | if (device->port.membase || device->port.iobase) | 204 | if (device->port.membase || device->port.iobase) |
200 | return 0; | 205 | return 0; |
201 | 206 | ||
202 | if ((err = parse_options(device, options)) < 0) | 207 | err = parse_options(device, options); |
208 | if (err < 0) | ||
203 | return err; | 209 | return err; |
204 | 210 | ||
205 | init_port(device); | 211 | init_port(device); |
@@ -219,7 +225,8 @@ int __init setup_early_serial8250_console(char *cmdline) | |||
219 | } | 225 | } |
220 | 226 | ||
221 | options = strchr(cmdline, ',') + 1; | 227 | options = strchr(cmdline, ',') + 1; |
222 | if ((err = early_serial8250_setup(options)) < 0) | 228 | err = early_serial8250_setup(options); |
229 | if (err < 0) | ||
223 | return err; | 230 | return err; |
224 | 231 | ||
225 | register_console(&early_serial8250_console); | 232 | register_console(&early_serial8250_console); |