projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d637837
)
tty: serial: altera_uart: Handle pdev->id == -1 in altera_uart_remove
author
Tobias Klauser
<
[email protected]
>
Wed, 9 Feb 2011 09:56:52 +0000
(10:56 +0100)
committer
Greg Kroah-Hartman
<
[email protected]
>
Thu, 17 Feb 2011 19:31:58 +0000
(11:31 -0800)
Commit
6b5756f176568a710d008d3b478128fafb6707f0
introduced the
possibility for pdev->id being -1 but the change was not done equally in
altera_uart_remove. This patch fixes this.
Acked-by: Anton Vorontsov <
[email protected]
>
Signed-off-by: Tobias Klauser <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/tty/serial/altera_uart.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/altera_uart.c
b/drivers/tty/serial/altera_uart.c
index 721216292a5049882847e9712735b0ca82950b1e..dee7a0eb6ea1a70431c36b5ca61977a0e7487591 100644
(file)
--- 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)
static int __devexit altera_uart_remove(struct platform_device *pdev)
{
- struct uart_port *port = &altera_uart_ports[pdev->id].port;
+ struct uart_port *port;
+ int i = pdev->id;
+ if (i == -1)
+ i = 0;
+
+ port = &altera_uart_ports[i].port;
uart_remove_one_port(&altera_uart_driver, port);
+
return 0;
}