提交 0fe1c137 编写于 作者: A Alan Cox 提交者: Linus Torvalds

8250_hp300: coding style

Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8b4a483b
...@@ -126,13 +126,11 @@ int __init hp300_setup_serial_console(void) ...@@ -126,13 +126,11 @@ int __init hp300_setup_serial_console(void)
printk(KERN_WARNING "Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n"); printk(KERN_WARNING "Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n");
return 0; return 0;
#endif #endif
} } else {
else {
#ifdef CONFIG_HPDCA #ifdef CONFIG_HPDCA
unsigned long pa = dio_scodetophysaddr(scode); unsigned long pa = dio_scodetophysaddr(scode);
if (!pa) { if (!pa)
return 0; return 0;
}
printk(KERN_INFO "Serial console is HP DCA at select code %d\n", scode); printk(KERN_INFO "Serial console is HP DCA at select code %d\n", scode);
...@@ -145,19 +143,16 @@ int __init hp300_setup_serial_console(void) ...@@ -145,19 +143,16 @@ int __init hp300_setup_serial_console(void)
/* Enable board-interrupts */ /* Enable board-interrupts */
out_8(pa + DIO_VIRADDRBASE + DCA_IC, DCA_IC_IE); out_8(pa + DIO_VIRADDRBASE + DCA_IC, DCA_IC_IE);
if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80) { if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80)
add_preferred_console("ttyS", port.line, "9600n8"); add_preferred_console("ttyS", port.line, "9600n8");
}
#else #else
printk(KERN_WARNING "Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n"); printk(KERN_WARNING "Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n");
return 0; return 0;
#endif #endif
} }
if (early_serial_setup(&port) < 0) { if (early_serial_setup(&port) < 0)
printk(KERN_WARNING "hp300_setup_serial_console(): early_serial_setup() failed.\n"); printk(KERN_WARNING "hp300_setup_serial_console(): early_serial_setup() failed.\n");
}
return 0; return 0;
} }
#endif /* CONFIG_SERIAL_8250_CONSOLE */ #endif /* CONFIG_SERIAL_8250_CONSOLE */
...@@ -210,7 +205,7 @@ static int __devinit hpdca_init_one(struct dio_dev *d, ...@@ -210,7 +205,7 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
static int __init hp300_8250_init(void) static int __init hp300_8250_init(void)
{ {
static int called = 0; static int called;
#ifdef CONFIG_HPAPCI #ifdef CONFIG_HPAPCI
int line; int line;
unsigned long base; unsigned long base;
...@@ -239,13 +234,12 @@ static int __init hp300_8250_init(void) ...@@ -239,13 +234,12 @@ static int __init hp300_8250_init(void)
* Port 1 is either the console or the DCA. * Port 1 is either the console or the DCA.
*/ */
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
/* Port 1 is the console on a 425e, on other machines it's mapped to /* Port 1 is the console on a 425e, on other machines it's
* DCA. * mapped to DCA.
*/ */
#ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef CONFIG_SERIAL_8250_CONSOLE
if (i == 1) { if (i == 1)
continue; continue;
}
#endif #endif
/* Create new serial device */ /* Create new serial device */
...@@ -259,7 +253,8 @@ static int __init hp300_8250_init(void) ...@@ -259,7 +253,8 @@ static int __init hp300_8250_init(void)
/* Memory mapped I/O */ /* Memory mapped I/O */
uport.iotype = UPIO_MEM; uport.iotype = UPIO_MEM;
uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ \
| UPF_BOOT_AUTOCONF;
/* XXX - no interrupt support yet */ /* XXX - no interrupt support yet */
uport.irq = 0; uport.irq = 0;
uport.uartclk = HPAPCI_BAUD_BASE * 16; uport.uartclk = HPAPCI_BAUD_BASE * 16;
...@@ -270,8 +265,8 @@ static int __init hp300_8250_init(void) ...@@ -270,8 +265,8 @@ static int __init hp300_8250_init(void)
line = serial8250_register_port(&uport); line = serial8250_register_port(&uport);
if (line < 0) { if (line < 0) {
printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" printk(KERN_NOTICE "8250_hp300: register_serial() APCI"
" irq %d failed\n", i, uport.irq); " %d irq %d failed\n", i, uport.irq);
kfree(port); kfree(port);
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册