Re: [PATCH 05/18] tty: serial: samsung_tty: add support for Apple UARTs

From: Hector Martin
Date: Mon Feb 08 2021 - 18:24:56 EST


On 09/02/2021 03.37, Krzysztof Kozlowski wrote:
Looking at Greg's comment, we can get rid of the PORT_ stuff entirely.
First of all, PORT_S3C2410 == PORT_S3C2412, so this define is not
accurate.

This leaves us with three types (s3c2400, s3c2440, s3c6410 and Apple).
The s3c2440 could be removed with adding a new "ucon_mask" field to
s3c24xx_serial_drv_data.

This would end with s3c24xx, s3c6410 and Apple - quite nice choice.

Works for me :)

You're right. This one would have to be improved before your change.
Instead of replacing specific op calls in startup, I think it's better
to have entirely separate ops instance for each variant:

static const struct uart_ops s3c24xx_serial_ops;
static const struct uart_ops s3c64xx_serial_ops;
static const struct uart_ops s5l_serial_ops;

This allows to add a "const", since uart_port takes such const pointer.

Still during s3c24xx_serial_probe() correct ops would have to be
assigned, but at least all ops are easily visible.

Roger, will do this for v2.

--
Hector Martin (marcan@xxxxxxxxx)
Public Key: https://mrcn.st/pub