Skip to content

Commit

Permalink
tty: serial: altera_uart: Handle pdev->id == -1 in altera_uart_remove
Browse files Browse the repository at this point in the history
Commit 6b5756f 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 <cbouatmailru@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Tobias Klauser authored and Greg Kroah-Hartman committed Feb 17, 2011
1 parent d637837 commit e96fabd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/tty/serial/altera_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e96fabd

Please sign in to comment.