diff options
author | Libo Chen <clbchenlibo.chen@huawei.com> | 2013-05-29 10:33:16 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 10:30:43 -0700 |
commit | 1b615beec7e8a1c40158c69a142e9e9832a6f7ad (patch) | |
tree | 2e8ed9d5796c494ab4bc53d20461a974c538dc41 /drivers/tty | |
parent | 147275983e42e07f4c9f3764a91ff65be026aea9 (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>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/ucc_uart.c | 4 |
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) } ret = platform_driver_register(&ucc_uart_of_driver); - if (ret) + if (ret) { printk(KERN_ERR "ucc-uart: could not register platform driver\n"); + uart_unregister_driver(&ucc_uart_driver); + } return ret; } |