mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
tty/serial: digicolor: Fix digicolor-usart already registered warning
When modprobe/rmmod/modprobe module, if platform_driver_register() fails, the kernel complained, proc_dir_entry 'driver/digicolor-usart' already registered WARNING: CPU: 1 PID: 5636 at fs/proc/generic.c:360 proc_register+0x19d/0x270 Fix this by adding uart_unregister_driver() when platform_driver_register() fails. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
929ffa4ade
commit
c7ad9ba061
1 changed files with 5 additions and 1 deletions
|
@ -541,7 +541,11 @@ static int __init digicolor_uart_init(void)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return platform_driver_register(&digicolor_uart_platform);
|
||||
ret = platform_driver_register(&digicolor_uart_platform);
|
||||
if (ret)
|
||||
uart_unregister_driver(&digicolor_uart);
|
||||
|
||||
return ret;
|
||||
}
|
||||
module_init(digicolor_uart_init);
|
||||
|
||||
|
|
Loading…
Reference in a new issue