diff options
Diffstat (limited to 'drivers/serial/ioc4_serial.c')
-rw-r--r-- | drivers/serial/ioc4_serial.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index 902b067d7e9c..836d9ab4f729 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
@@ -2913,17 +2913,27 @@ static int __init ioc4_serial_init(void) | |||
2913 | printk(KERN_WARNING | 2913 | printk(KERN_WARNING |
2914 | "%s: Couldn't register rs232 IOC4 serial driver\n", | 2914 | "%s: Couldn't register rs232 IOC4 serial driver\n", |
2915 | __func__); | 2915 | __func__); |
2916 | return ret; | 2916 | goto out; |
2917 | } | 2917 | } |
2918 | if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { | 2918 | if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) { |
2919 | printk(KERN_WARNING | 2919 | printk(KERN_WARNING |
2920 | "%s: Couldn't register rs422 IOC4 serial driver\n", | 2920 | "%s: Couldn't register rs422 IOC4 serial driver\n", |
2921 | __func__); | 2921 | __func__); |
2922 | return ret; | 2922 | goto out_uart_rs232; |
2923 | } | 2923 | } |
2924 | 2924 | ||
2925 | /* register with IOC4 main module */ | 2925 | /* register with IOC4 main module */ |
2926 | return ioc4_register_submodule(&ioc4_serial_submodule); | 2926 | ret = ioc4_register_submodule(&ioc4_serial_submodule); |
2927 | if (ret) | ||
2928 | goto out_uart_rs422; | ||
2929 | return 0; | ||
2930 | |||
2931 | out_uart_rs422: | ||
2932 | uart_unregister_driver(&ioc4_uart_rs422); | ||
2933 | out_uart_rs232: | ||
2934 | uart_unregister_driver(&ioc4_uart_rs232); | ||
2935 | out: | ||
2936 | return ret; | ||
2927 | } | 2937 | } |
2928 | 2938 | ||
2929 | static void __exit ioc4_serial_exit(void) | 2939 | static void __exit ioc4_serial_exit(void) |