1
0
Fork 0

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>
hifive-unleashed-5.1
Libo Chen 2013-05-29 10:33:16 +08:00 committed by Greg Kroah-Hartman
parent 147275983e
commit 1b615beec7
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}