Re: [PATCH v11 10/10] tty: serial: Add Nuvoton ma35d1 serial driver support

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

 



On Wed, May 24, 2023, at 10:34, Jacky Huang wrote:
> On 2023/5/24 下午 03:42, Jiri Slaby wrote:
>> On 16. 05. 23, 9:52, Jacky Huang wrote:
>>> +static void ma35d1serial_config_port(struct uart_port *port, int flags)
>>> +{
>>> +    /*
>>> +     * Driver core for serial ports forces a non-zero value for port 
>>> type.
>>> +     * Write an arbitrary value here to accommodate the serial core 
>>> driver,
>>> +     * as ID part of UAPI is redundant.
>>> +     */
>>> +    port->type = 1;
>>
>> So this 1 translates to PORT_8250. Why not to use it directly? Or 
>> something more saner like PORT_16550A?
>>
> It's not actually 8250 or 16550A.
> Can we add the following definition to 
> 'include/uapi/linux/serial_core.h' and use PORT_MA35 instead?
>
> #define PORT_MA35    124

This was already in a previous version, until Greg commented
that it was probably not needed:

https://lore.kernel.org/lkml/20fc81c9-5517-ce1e-639a-3b425cf27759@xxxxxxxxx/

Since leaving port->type at PORT_UNKNOWN doesn't work, and almost
all other drivers have something in serial_core.h, it's probably
best to do the same here. Checking the other drivers showed that
drivers/tty/serial/lantiq.c is currently the only exception, it
defines PORT_LTQ_ASC locally, which causes a conflict with
PORT_SPRD.

    Arnd




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux