提交 c7ad9ba0 编写于 作者: K Kefeng Wang 提交者: Greg Kroah-Hartman

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: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: NBaruch Siach <baruch@tkos.co.il>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 929ffa4a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册