aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/8250_hp300.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/serial/8250_hp300.c b/drivers/serial/8250_hp300.c
index 2cf0953fe0ec..0e1410f2c033 100644
--- a/drivers/serial/8250_hp300.c
+++ b/drivers/serial/8250_hp300.c
@@ -36,7 +36,7 @@ static struct hp300_port *hp300_ports;
36#ifdef CONFIG_HPDCA 36#ifdef CONFIG_HPDCA
37 37
38static int __devinit hpdca_init_one(struct dio_dev *d, 38static int __devinit hpdca_init_one(struct dio_dev *d,
39 const struct dio_device_id *ent); 39 const struct dio_device_id *ent);
40static void __devexit hpdca_remove_one(struct dio_dev *d); 40static void __devexit hpdca_remove_one(struct dio_dev *d);
41 41
42static struct dio_device_id hpdca_dio_tbl[] = { 42static struct dio_device_id hpdca_dio_tbl[] = {
@@ -85,7 +85,7 @@ extern int hp300_uart_scode;
85 85
86#ifdef CONFIG_SERIAL_8250_CONSOLE 86#ifdef CONFIG_SERIAL_8250_CONSOLE
87/* 87/*
88 * Parse the bootinfo to find descriptions for headless console and 88 * Parse the bootinfo to find descriptions for headless console and
89 * debug serial ports and register them with the 8250 driver. 89 * debug serial ports and register them with the 8250 driver.
90 * This function should be called before serial_console_init() is called 90 * This function should be called before serial_console_init() is called
91 * to make sure the serial console will be available for use. IA-64 kernel 91 * to make sure the serial console will be available for use. IA-64 kernel
@@ -126,13 +126,11 @@ int __init hp300_setup_serial_console(void)
126 printk(KERN_WARNING "Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n"); 126 printk(KERN_WARNING "Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n");
127 return 0; 127 return 0;
128#endif 128#endif
129 } 129 } else {
130 else {
131#ifdef CONFIG_HPDCA 130#ifdef CONFIG_HPDCA
132 unsigned long pa = dio_scodetophysaddr(scode); 131 unsigned long pa = dio_scodetophysaddr(scode);
133 if (!pa) { 132 if (!pa)
134 return 0; 133 return 0;
135 }
136 134
137 printk(KERN_INFO "Serial console is HP DCA at select code %d\n", scode); 135 printk(KERN_INFO "Serial console is HP DCA at select code %d\n", scode);
138 136
@@ -145,26 +143,23 @@ int __init hp300_setup_serial_console(void)
145 /* Enable board-interrupts */ 143 /* Enable board-interrupts */
146 out_8(pa + DIO_VIRADDRBASE + DCA_IC, DCA_IC_IE); 144 out_8(pa + DIO_VIRADDRBASE + DCA_IC, DCA_IC_IE);
147 145
148 if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80) { 146 if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80)
149 add_preferred_console("ttyS", port.line, "9600n8"); 147 add_preferred_console("ttyS", port.line, "9600n8");
150 }
151#else 148#else
152 printk(KERN_WARNING "Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n"); 149 printk(KERN_WARNING "Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n");
153 return 0; 150 return 0;
154#endif 151#endif
155 } 152 }
156 153
157 if (early_serial_setup(&port) < 0) { 154 if (early_serial_setup(&port) < 0)
158 printk(KERN_WARNING "hp300_setup_serial_console(): early_serial_setup() failed.\n"); 155 printk(KERN_WARNING "hp300_setup_serial_console(): early_serial_setup() failed.\n");
159 }
160
161 return 0; 156 return 0;
162} 157}
163#endif /* CONFIG_SERIAL_8250_CONSOLE */ 158#endif /* CONFIG_SERIAL_8250_CONSOLE */
164 159
165#ifdef CONFIG_HPDCA 160#ifdef CONFIG_HPDCA
166static int __devinit hpdca_init_one(struct dio_dev *d, 161static int __devinit hpdca_init_one(struct dio_dev *d,
167 const struct dio_device_id *ent) 162 const struct dio_device_id *ent)
168{ 163{
169 struct uart_port port; 164 struct uart_port port;
170 int line; 165 int line;
@@ -210,7 +205,7 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
210 205
211static int __init hp300_8250_init(void) 206static int __init hp300_8250_init(void)
212{ 207{
213 static int called = 0; 208 static int called;
214#ifdef CONFIG_HPAPCI 209#ifdef CONFIG_HPAPCI
215 int line; 210 int line;
216 unsigned long base; 211 unsigned long base;
@@ -239,13 +234,12 @@ static int __init hp300_8250_init(void)
239 * Port 1 is either the console or the DCA. 234 * Port 1 is either the console or the DCA.
240 */ 235 */
241 for (i = 1; i < 4; i++) { 236 for (i = 1; i < 4; i++) {
242 /* Port 1 is the console on a 425e, on other machines it's mapped to 237 /* Port 1 is the console on a 425e, on other machines it's
243 * DCA. 238 * mapped to DCA.
244 */ 239 */
245#ifdef CONFIG_SERIAL_8250_CONSOLE 240#ifdef CONFIG_SERIAL_8250_CONSOLE
246 if (i == 1) { 241 if (i == 1)
247 continue; 242 continue;
248 }
249#endif 243#endif
250 244
251 /* Create new serial device */ 245 /* Create new serial device */
@@ -259,7 +253,8 @@ static int __init hp300_8250_init(void)
259 253
260 /* Memory mapped I/O */ 254 /* Memory mapped I/O */
261 uport.iotype = UPIO_MEM; 255 uport.iotype = UPIO_MEM;
262 uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; 256 uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ \
257 | UPF_BOOT_AUTOCONF;
263 /* XXX - no interrupt support yet */ 258 /* XXX - no interrupt support yet */
264 uport.irq = 0; 259 uport.irq = 0;
265 uport.uartclk = HPAPCI_BAUD_BASE * 16; 260 uport.uartclk = HPAPCI_BAUD_BASE * 16;
@@ -270,8 +265,8 @@ static int __init hp300_8250_init(void)
270 line = serial8250_register_port(&uport); 265 line = serial8250_register_port(&uport);
271 266
272 if (line < 0) { 267 if (line < 0) {
273 printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" 268 printk(KERN_NOTICE "8250_hp300: register_serial() APCI"
274 " irq %d failed\n", i, uport.irq); 269 " %d irq %d failed\n", i, uport.irq);
275 kfree(port); 270 kfree(port);
276 continue; 271 continue;
277 } 272 }