diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-26 10:37:45 -0400 |
---|---|---|
committer | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-04-26 10:37:45 -0400 |
commit | 2b49abac5855aff9b42cf2cdb5376ac805bebd86 (patch) | |
tree | 50633da8be83ec2a965edd75466dfaa9e8075499 /drivers/serial/8250_hp300.c | |
parent | 2a9604b863c854e5bee409157aabb35b6ce8ecd3 (diff) |
[PATCH] Serial: Convert 8250_hp300 to use serial8250_{un,}register_port
Convert 8250_hp300 to use serial8250_register_port() and
serial8250_unregister_port().
Tested by Kars de Jong, 4/4/2005.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/8250_hp300.c')
-rw-r--r-- | drivers/serial/8250_hp300.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/serial/8250_hp300.c b/drivers/serial/8250_hp300.c index b8d51eb56bff..4315afe9c080 100644 --- a/drivers/serial/8250_hp300.c +++ b/drivers/serial/8250_hp300.c | |||
@@ -9,15 +9,15 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/tty.h> | ||
13 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
14 | #include <linux/serialP.h> | ||
15 | #include <linux/serial_core.h> | 13 | #include <linux/serial_core.h> |
16 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
17 | #include <linux/dio.h> | 15 | #include <linux/dio.h> |
18 | #include <linux/console.h> | 16 | #include <linux/console.h> |
19 | #include <asm/io.h> | 17 | #include <asm/io.h> |
20 | 18 | ||
19 | #include "8250.h" | ||
20 | |||
21 | #if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI) | 21 | #if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI) |
22 | #warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure? | 22 | #warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure? |
23 | #endif | 23 | #endif |
@@ -163,7 +163,7 @@ int __init hp300_setup_serial_console(void) | |||
163 | static int __devinit hpdca_init_one(struct dio_dev *d, | 163 | static int __devinit hpdca_init_one(struct dio_dev *d, |
164 | const struct dio_device_id *ent) | 164 | const struct dio_device_id *ent) |
165 | { | 165 | { |
166 | struct serial_struct serial_req; | 166 | struct uart_port port; |
167 | int line; | 167 | int line; |
168 | 168 | ||
169 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 169 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
@@ -172,21 +172,22 @@ static int __devinit hpdca_init_one(struct dio_dev *d, | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | #endif | 174 | #endif |
175 | memset(&serial_req, 0, sizeof(struct serial_struct)); | 175 | memset(&port, 0, sizeof(struct uart_port)); |
176 | 176 | ||
177 | /* Memory mapped I/O */ | 177 | /* Memory mapped I/O */ |
178 | serial_req.io_type = SERIAL_IO_MEM; | 178 | port.iotype = UPIO_MEM; |
179 | serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; | 179 | port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; |
180 | serial_req.irq = d->ipl; | 180 | port.irq = d->ipl; |
181 | serial_req.baud_base = HPDCA_BAUD_BASE; | 181 | port.uartclk = HPDCA_BAUD_BASE * 16; |
182 | serial_req.iomap_base = (d->resource.start + UART_OFFSET); | 182 | port.mapbase = (d->resource.start + UART_OFFSET); |
183 | serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); | 183 | port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); |
184 | serial_req.iomem_reg_shift = 1; | 184 | port.regshift = 1; |
185 | line = register_serial(&serial_req); | 185 | port.dev = &d->dev; |
186 | line = serial8250_register_port(&port); | ||
186 | 187 | ||
187 | if (line < 0) { | 188 | if (line < 0) { |
188 | printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" | 189 | printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" |
189 | " irq %d failed\n", d->scode, serial_req.irq); | 190 | " irq %d failed\n", d->scode, port.irq); |
190 | return -ENOMEM; | 191 | return -ENOMEM; |
191 | } | 192 | } |
192 | 193 | ||
@@ -209,7 +210,7 @@ static int __init hp300_8250_init(void) | |||
209 | #ifdef CONFIG_HPAPCI | 210 | #ifdef CONFIG_HPAPCI |
210 | int line; | 211 | int line; |
211 | unsigned long base; | 212 | unsigned long base; |
212 | struct serial_struct serial_req; | 213 | struct uart_port uport; |
213 | struct hp300_port *port; | 214 | struct hp300_port *port; |
214 | int i; | 215 | int i; |
215 | #endif | 216 | #endif |
@@ -251,25 +252,25 @@ static int __init hp300_8250_init(void) | |||
251 | if (!port) | 252 | if (!port) |
252 | return -ENOMEM; | 253 | return -ENOMEM; |
253 | 254 | ||
254 | memset(&serial_req, 0, sizeof(struct serial_struct)); | 255 | memset(&uport, 0, sizeof(struct uart_port)); |
255 | 256 | ||
256 | base = (FRODO_BASE + FRODO_APCI_OFFSET(i)); | 257 | base = (FRODO_BASE + FRODO_APCI_OFFSET(i)); |
257 | 258 | ||
258 | /* Memory mapped I/O */ | 259 | /* Memory mapped I/O */ |
259 | serial_req.io_type = SERIAL_IO_MEM; | 260 | uport.iotype = UPIO_MEM; |
260 | serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; | 261 | uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; |
261 | /* XXX - no interrupt support yet */ | 262 | /* XXX - no interrupt support yet */ |
262 | serial_req.irq = 0; | 263 | uport.irq = 0; |
263 | serial_req.baud_base = HPAPCI_BAUD_BASE; | 264 | uport.uartclk = HPAPCI_BAUD_BASE * 16; |
264 | serial_req.iomap_base = base; | 265 | uport.mapbase = base; |
265 | serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); | 266 | uport.membase = (char *)(base + DIO_VIRADDRBASE); |
266 | serial_req.iomem_reg_shift = 2; | 267 | uport.regshift = 2; |
267 | 268 | ||
268 | line = register_serial(&serial_req); | 269 | line = serial8250_register_port(&uport); |
269 | 270 | ||
270 | if (line < 0) { | 271 | if (line < 0) { |
271 | printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" | 272 | printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" |
272 | " irq %d failed\n", i, serial_req.irq); | 273 | " irq %d failed\n", i, uport.irq); |
273 | kfree(port); | 274 | kfree(port); |
274 | continue; | 275 | continue; |
275 | } | 276 | } |
@@ -299,7 +300,7 @@ static void __devexit hpdca_remove_one(struct dio_dev *d) | |||
299 | /* Disable board-interrupts */ | 300 | /* Disable board-interrupts */ |
300 | out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0); | 301 | out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0); |
301 | } | 302 | } |
302 | unregister_serial(line); | 303 | serial8250_unregister_port(line); |
303 | } | 304 | } |
304 | #endif | 305 | #endif |
305 | 306 | ||
@@ -309,7 +310,7 @@ static void __exit hp300_8250_exit(void) | |||
309 | struct hp300_port *port, *to_free; | 310 | struct hp300_port *port, *to_free; |
310 | 311 | ||
311 | for (port = hp300_ports; port; ) { | 312 | for (port = hp300_ports; port; ) { |
312 | unregister_serial(port->line); | 313 | serial8250_unregister_port(port->line); |
313 | to_free = port; | 314 | to_free = port; |
314 | port = port->next; | 315 | port = port->next; |
315 | kfree(to_free); | 316 | kfree(to_free); |