Re: [PATCH v9 06/10] serial: sh-sci: Use private port ID

Wolfram Sang
2025-05-21T11:00:50Z

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

On Thu, May 15, 2025 at 04:18:21PM +0200, Thierry Bultel wrote:
> New port types cannot be added in serial_core.h, which is shared with
> userspace.
> In order to support new port types, the coming new ones will have
> BIT(7) set in the id value, and in this case, uartport->type is
> set to PORT_GENERIC.
> This commit therefore changes all the places where the port type is
> read, by not relying on uartport->type but on the private
> value stored in struct sci_port.

I quite like this approach to become independent of serial_core.h by
adding a driver-local type. Because it changes only access to the
variables but not much the logic of this driver. Two high level comments
I do have:

- I'd go for bit 31 as the flag, though. It is extremly unlikely that we
ever need a number in serial_core.h again, but if, it could likely be
> 127

- whatever bit numer we choose, it should be hidden as a constant. My
suggestion:

#define SCI_LOCAL_PORT_FLAG BIT(x)

?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]