diff options
Diffstat (limited to 'drivers/tty/serial/mpc52xx_uart.c')
-rw-r--r-- | drivers/tty/serial/mpc52xx_uart.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index 018bad922554..f51b280f3bf2 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c | |||
@@ -1497,18 +1497,23 @@ mpc52xx_uart_init(void) | |||
1497 | if (psc_ops && psc_ops->fifoc_init) { | 1497 | if (psc_ops && psc_ops->fifoc_init) { |
1498 | ret = psc_ops->fifoc_init(); | 1498 | ret = psc_ops->fifoc_init(); |
1499 | if (ret) | 1499 | if (ret) |
1500 | return ret; | 1500 | goto err_init; |
1501 | } | 1501 | } |
1502 | 1502 | ||
1503 | ret = platform_driver_register(&mpc52xx_uart_of_driver); | 1503 | ret = platform_driver_register(&mpc52xx_uart_of_driver); |
1504 | if (ret) { | 1504 | if (ret) { |
1505 | printk(KERN_ERR "%s: platform_driver_register failed (%i)\n", | 1505 | printk(KERN_ERR "%s: platform_driver_register failed (%i)\n", |
1506 | __FILE__, ret); | 1506 | __FILE__, ret); |
1507 | uart_unregister_driver(&mpc52xx_uart_driver); | 1507 | goto err_reg; |
1508 | return ret; | ||
1509 | } | 1508 | } |
1510 | 1509 | ||
1511 | return 0; | 1510 | return 0; |
1511 | err_reg: | ||
1512 | if (psc_ops && psc_ops->fifoc_uninit) | ||
1513 | psc_ops->fifoc_uninit(); | ||
1514 | err_init: | ||
1515 | uart_unregister_driver(&mpc52xx_uart_driver); | ||
1516 | return ret; | ||
1512 | } | 1517 | } |
1513 | 1518 | ||
1514 | static void __exit | 1519 | static void __exit |