diff options
Diffstat (limited to 'drivers/serial/8250.c')
-rw-r--r-- | drivers/serial/8250.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 98820603e75f..d2bcd1f87cd6 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -102,7 +102,7 @@ static unsigned int share_irqs = SERIAL8250_SHARE_IRQS; | |||
102 | #define SERIAL_PORT_DFNS | 102 | #define SERIAL_PORT_DFNS |
103 | #endif | 103 | #endif |
104 | 104 | ||
105 | static struct old_serial_port old_serial_port[] = { | 105 | static const struct old_serial_port old_serial_port[] = { |
106 | SERIAL_PORT_DFNS /* defined in asm/serial.h */ | 106 | SERIAL_PORT_DFNS /* defined in asm/serial.h */ |
107 | }; | 107 | }; |
108 | 108 | ||
@@ -999,7 +999,10 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) | |||
999 | serial_outp(up, UART_MCR, save_mcr); | 999 | serial_outp(up, UART_MCR, save_mcr); |
1000 | serial8250_clear_fifos(up); | 1000 | serial8250_clear_fifos(up); |
1001 | (void)serial_in(up, UART_RX); | 1001 | (void)serial_in(up, UART_RX); |
1002 | serial_outp(up, UART_IER, 0); | 1002 | if (up->capabilities & UART_CAP_UUE) |
1003 | serial_outp(up, UART_IER, UART_IER_UUE); | ||
1004 | else | ||
1005 | serial_outp(up, UART_IER, 0); | ||
1003 | 1006 | ||
1004 | out: | 1007 | out: |
1005 | spin_unlock_irqrestore(&up->port.lock, flags); | 1008 | spin_unlock_irqrestore(&up->port.lock, flags); |
@@ -2381,9 +2384,9 @@ void serial8250_resume_port(int line) | |||
2381 | * list is terminated with a zero flags entry, which means we expect | 2384 | * list is terminated with a zero flags entry, which means we expect |
2382 | * all entries to have at least UPF_BOOT_AUTOCONF set. | 2385 | * all entries to have at least UPF_BOOT_AUTOCONF set. |
2383 | */ | 2386 | */ |
2384 | static int __devinit serial8250_probe(struct device *dev) | 2387 | static int __devinit serial8250_probe(struct platform_device *dev) |
2385 | { | 2388 | { |
2386 | struct plat_serial8250_port *p = dev->platform_data; | 2389 | struct plat_serial8250_port *p = dev->dev.platform_data; |
2387 | struct uart_port port; | 2390 | struct uart_port port; |
2388 | int ret, i; | 2391 | int ret, i; |
2389 | 2392 | ||
@@ -2399,12 +2402,12 @@ static int __devinit serial8250_probe(struct device *dev) | |||
2399 | port.flags = p->flags; | 2402 | port.flags = p->flags; |
2400 | port.mapbase = p->mapbase; | 2403 | port.mapbase = p->mapbase; |
2401 | port.hub6 = p->hub6; | 2404 | port.hub6 = p->hub6; |
2402 | port.dev = dev; | 2405 | port.dev = &dev->dev; |
2403 | if (share_irqs) | 2406 | if (share_irqs) |
2404 | port.flags |= UPF_SHARE_IRQ; | 2407 | port.flags |= UPF_SHARE_IRQ; |
2405 | ret = serial8250_register_port(&port); | 2408 | ret = serial8250_register_port(&port); |
2406 | if (ret < 0) { | 2409 | if (ret < 0) { |
2407 | dev_err(dev, "unable to register port at index %d " | 2410 | dev_err(&dev->dev, "unable to register port at index %d " |
2408 | "(IO%lx MEM%lx IRQ%d): %d\n", i, | 2411 | "(IO%lx MEM%lx IRQ%d): %d\n", i, |
2409 | p->iobase, p->mapbase, p->irq, ret); | 2412 | p->iobase, p->mapbase, p->irq, ret); |
2410 | } | 2413 | } |
@@ -2415,54 +2418,55 @@ static int __devinit serial8250_probe(struct device *dev) | |||
2415 | /* | 2418 | /* |
2416 | * Remove serial ports registered against a platform device. | 2419 | * Remove serial ports registered against a platform device. |
2417 | */ | 2420 | */ |
2418 | static int __devexit serial8250_remove(struct device *dev) | 2421 | static int __devexit serial8250_remove(struct platform_device *dev) |
2419 | { | 2422 | { |
2420 | int i; | 2423 | int i; |
2421 | 2424 | ||
2422 | for (i = 0; i < UART_NR; i++) { | 2425 | for (i = 0; i < UART_NR; i++) { |
2423 | struct uart_8250_port *up = &serial8250_ports[i]; | 2426 | struct uart_8250_port *up = &serial8250_ports[i]; |
2424 | 2427 | ||
2425 | if (up->port.dev == dev) | 2428 | if (up->port.dev == &dev->dev) |
2426 | serial8250_unregister_port(i); | 2429 | serial8250_unregister_port(i); |
2427 | } | 2430 | } |
2428 | return 0; | 2431 | return 0; |
2429 | } | 2432 | } |
2430 | 2433 | ||
2431 | static int serial8250_suspend(struct device *dev, pm_message_t state) | 2434 | static int serial8250_suspend(struct platform_device *dev, pm_message_t state) |
2432 | { | 2435 | { |
2433 | int i; | 2436 | int i; |
2434 | 2437 | ||
2435 | for (i = 0; i < UART_NR; i++) { | 2438 | for (i = 0; i < UART_NR; i++) { |
2436 | struct uart_8250_port *up = &serial8250_ports[i]; | 2439 | struct uart_8250_port *up = &serial8250_ports[i]; |
2437 | 2440 | ||
2438 | if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) | 2441 | if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) |
2439 | uart_suspend_port(&serial8250_reg, &up->port); | 2442 | uart_suspend_port(&serial8250_reg, &up->port); |
2440 | } | 2443 | } |
2441 | 2444 | ||
2442 | return 0; | 2445 | return 0; |
2443 | } | 2446 | } |
2444 | 2447 | ||
2445 | static int serial8250_resume(struct device *dev) | 2448 | static int serial8250_resume(struct platform_device *dev) |
2446 | { | 2449 | { |
2447 | int i; | 2450 | int i; |
2448 | 2451 | ||
2449 | for (i = 0; i < UART_NR; i++) { | 2452 | for (i = 0; i < UART_NR; i++) { |
2450 | struct uart_8250_port *up = &serial8250_ports[i]; | 2453 | struct uart_8250_port *up = &serial8250_ports[i]; |
2451 | 2454 | ||
2452 | if (up->port.type != PORT_UNKNOWN && up->port.dev == dev) | 2455 | if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev) |
2453 | uart_resume_port(&serial8250_reg, &up->port); | 2456 | uart_resume_port(&serial8250_reg, &up->port); |
2454 | } | 2457 | } |
2455 | 2458 | ||
2456 | return 0; | 2459 | return 0; |
2457 | } | 2460 | } |
2458 | 2461 | ||
2459 | static struct device_driver serial8250_isa_driver = { | 2462 | static struct platform_driver serial8250_isa_driver = { |
2460 | .name = "serial8250", | ||
2461 | .bus = &platform_bus_type, | ||
2462 | .probe = serial8250_probe, | 2463 | .probe = serial8250_probe, |
2463 | .remove = __devexit_p(serial8250_remove), | 2464 | .remove = __devexit_p(serial8250_remove), |
2464 | .suspend = serial8250_suspend, | 2465 | .suspend = serial8250_suspend, |
2465 | .resume = serial8250_resume, | 2466 | .resume = serial8250_resume, |
2467 | .driver = { | ||
2468 | .name = "serial8250", | ||
2469 | }, | ||
2466 | }; | 2470 | }; |
2467 | 2471 | ||
2468 | /* | 2472 | /* |
@@ -2608,7 +2612,7 @@ static int __init serial8250_init(void) | |||
2608 | 2612 | ||
2609 | serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); | 2613 | serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); |
2610 | 2614 | ||
2611 | ret = driver_register(&serial8250_isa_driver); | 2615 | ret = platform_driver_register(&serial8250_isa_driver); |
2612 | if (ret == 0) | 2616 | if (ret == 0) |
2613 | goto out; | 2617 | goto out; |
2614 | 2618 | ||
@@ -2630,7 +2634,7 @@ static void __exit serial8250_exit(void) | |||
2630 | */ | 2634 | */ |
2631 | serial8250_isa_devs = NULL; | 2635 | serial8250_isa_devs = NULL; |
2632 | 2636 | ||
2633 | driver_unregister(&serial8250_isa_driver); | 2637 | platform_driver_unregister(&serial8250_isa_driver); |
2634 | platform_device_unregister(isa_dev); | 2638 | platform_device_unregister(isa_dev); |
2635 | 2639 | ||
2636 | uart_unregister_driver(&serial8250_reg); | 2640 | uart_unregister_driver(&serial8250_reg); |