diff options
Diffstat (limited to 'drivers/tty/serial/altera_uart.c')
-rw-r--r-- | drivers/tty/serial/altera_uart.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index 721216292a50..dee7a0eb6ea1 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c | |||
@@ -561,9 +561,15 @@ static int __devinit altera_uart_probe(struct platform_device *pdev) | |||
561 | 561 | ||
562 | static int __devexit altera_uart_remove(struct platform_device *pdev) | 562 | static int __devexit altera_uart_remove(struct platform_device *pdev) |
563 | { | 563 | { |
564 | struct uart_port *port = &altera_uart_ports[pdev->id].port; | 564 | struct uart_port *port; |
565 | int i = pdev->id; | ||
565 | 566 | ||
567 | if (i == -1) | ||
568 | i = 0; | ||
569 | |||
570 | port = &altera_uart_ports[i].port; | ||
566 | uart_remove_one_port(&altera_uart_driver, port); | 571 | uart_remove_one_port(&altera_uart_driver, port); |
572 | |||
567 | return 0; | 573 | return 0; |
568 | } | 574 | } |
569 | 575 | ||