[PATCH v2] tty: serial: samsung_tty: support more than 4 uart ports

Chanho Park chanho61.park at samsung.com
Mon Jul 4 01:11:22 PDT 2022


> > --- a/drivers/tty/serial/samsung_tty.c
> > +++ b/drivers/tty/serial/samsung_tty.c
> ...
> > @@ -1810,67 +1816,27 @@ static const struct uart_ops
> > apple_s5l_serial_ops = {
> ...
> > +static struct s3c24xx_uart_port s3c24xx_serial_ports[UART_NR];
> > +
> > +static void s3c24xx_serial_init_port_default(int index) {
> 
> The opening brace should be on a separate line.

Oh, I missed this. Thanks for your review.
I'll make a separate patch to fix this.

> 
> > +	struct uart_port *port = &s3c24xx_serial_ports[index].port;
> > +
> > +	spin_lock_init(&port->lock);
> > +
> > +	port->iotype = UPIO_MEM;
> > +	port->uartclk = 0;
> > +	port->fifosize = 16;
> > +	port->ops = &s3c24xx_serial_ops;
> > +	port->flags = UPF_BOOT_AUTOCONF;
> > +	port->line = index;
> > +}
> >
> >   /* s3c24xx_serial_resetport
> >    *
> > @@ -2186,6 +2152,8 @@ static int s3c24xx_serial_probe(struct
> platform_device *pdev)
> >   	}
> >   	ourport = &s3c24xx_serial_ports[index];
> >
> > +	s3c24xx_serial_init_port_default(index);
> 
> Perhaps pass &ourport->port to the function too -- you'd save the refetch
> there.

&ourport->port will be retrieved by index in the s3c24xx_serial_init_port_default.
Why do I need to pass it?

+	struct uart_port *port = &s3c24xx_serial_ports[index].port;

Best Regards,
Chanho Park




More information about the linux-arm-kernel mailing list