提交 e96fabd8 编写于 作者: T Tobias Klauser 提交者: Greg Kroah-Hartman

tty: serial: altera_uart: Handle pdev->id == -1 in altera_uart_remove

Commit 6b5756f1 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: NAnton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d6378375
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册