All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chanho Park" <chanho61.park@samsung.com>
To: "'Jiri Slaby'" <jirislaby@kernel.org>,
	"'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>
Cc: "'Alim Akhtar'" <alim.akhtar@samsung.com>,
	"'Hector Martin'" <marcan@marcan.st>,
	"'Jaewon Kim'" <jaewon02.kim@samsung.com>,
	"'Vincent Whitchurch'" <vincent.whitchurch@axis.com>,
	<linux-samsung-soc@vger.kernel.org>,
	<linux-serial@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v2] tty: serial: samsung_tty: support more than 4 uart ports
Date: Mon, 4 Jul 2022 17:11:22 +0900	[thread overview]
Message-ID: <004401d88f7d$a6166880$f2433980$@samsung.com> (raw)
In-Reply-To: <c7157f50-4739-2365-f394-826ff91637ed@kernel.org>

> > --- 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


WARNING: multiple messages have this Message-ID (diff)
From: "Chanho Park" <chanho61.park@samsung.com>
To: "'Jiri Slaby'" <jirislaby@kernel.org>,
	"'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>
Cc: "'Alim Akhtar'" <alim.akhtar@samsung.com>,
	"'Hector Martin'" <marcan@marcan.st>,
	"'Jaewon Kim'" <jaewon02.kim@samsung.com>,
	"'Vincent Whitchurch'" <vincent.whitchurch@axis.com>,
	<linux-samsung-soc@vger.kernel.org>,
	<linux-serial@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v2] tty: serial: samsung_tty: support more than 4 uart ports
Date: Mon, 4 Jul 2022 17:11:22 +0900	[thread overview]
Message-ID: <004401d88f7d$a6166880$f2433980$@samsung.com> (raw)
In-Reply-To: <c7157f50-4739-2365-f394-826ff91637ed@kernel.org>

> > --- 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-04  8:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220629005750epcas2p418cd79922d1b3f13eda761ee3fcd3e17@epcas2p4.samsung.com>
2022-06-29  0:55 ` [PATCH v2] tty: serial: samsung_tty: support more than 4 uart ports Chanho Park
2022-06-29  0:55   ` Chanho Park
2022-06-29  7:30   ` Krzysztof Kozlowski
2022-06-29  7:30     ` Krzysztof Kozlowski
2022-06-29 11:13   ` Hector Martin
2022-06-29 11:13     ` Hector Martin
2022-07-04  7:40   ` Jiri Slaby
2022-07-04  7:40     ` Jiri Slaby
2022-07-04  8:11     ` Chanho Park [this message]
2022-07-04  8:11       ` Chanho Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004401d88f7d$a6166880$f2433980$@samsung.com' \
    --to=chanho61.park@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaewon02.kim@samsung.com \
    --cc=jirislaby@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=vincent.whitchurch@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.