RE: [PATCH v4] tty: serial: add Freescale lpuart driver support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>> +static int __init lpuart_serial_init(void) {
>> +	int ret;
>> +
>> +	pr_info("serial: Freescale lpuart driver\n");
>> +
>> +	ret = uart_register_driver(&lpuart_reg);
>> +	if (ret)
>> +		return ret;
>> +
>> +	ret = platform_driver_register(&lpuart_uart_driver);
>> +	if (ret)
>> +		uart_unregister_driver(&lpuart_reg);
>> +
>> +	return 0;
>> +}
>> +
>> +static void __exit lpuart_serial_exit(void) {
>> +	platform_driver_unregister(&lpuart_uart_driver);
>> +	uart_unregister_driver(&lpuart_reg);
>> +}
>> +
>> +module_init(lpuart_serial_init);
>> +module_exit(lpuart_serial_exit);
>
>I think you can call uart_register_driver and uart_unregister_driver
>in .probe and .remove hook, and then you can simply use
>module_platform_driver for lpuart_uart_driver.
[Lu Jingchang-B35083] 
  For multiple dts uart nodes, each node will call .probe once. If the uart_register_driver is called from .probe without any conditioning check, it will then be called more than once, but the uart_register_deiver can only register the same uart driver once. So I think current arrangement will be more reasonable. Thanks!


--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux