aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibo Chen <clbchenlibo.chen@huawei.com>2013-05-28 22:33:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 13:30:43 -0400
commit1b615beec7e8a1c40158c69a142e9e9832a6f7ad (patch)
tree2e8ed9d5796c494ab4bc53d20461a974c538dc41
parent147275983e42e07f4c9f3764a91ff65be026aea9 (diff)
driver: tty: add missing unregister in err case
when platform_driver_register broken, we should unregister ucc_uart_driver Signed-off-by: Libo chen <libo.chen@huawei.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/ucc_uart.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index c8ab8e45e1b9..88317482b81f 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1517,9 +1517,11 @@ static int __init ucc_uart_init(void)
1517 } 1517 }
1518 1518
1519 ret = platform_driver_register(&ucc_uart_of_driver); 1519 ret = platform_driver_register(&ucc_uart_of_driver);
1520 if (ret) 1520 if (ret) {
1521 printk(KERN_ERR 1521 printk(KERN_ERR
1522 "ucc-uart: could not register platform driver\n"); 1522 "ucc-uart: could not register platform driver\n");
1523 uart_unregister_driver(&ucc_uart_driver);
1524 }
1523 1525
1524 return ret; 1526 return ret;
1525} 1527}