[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220625201912.GA29720@wunner.de>
Date: Sat, 25 Jun 2022 22:19:12 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: linux-serial@...r.kernel.org, Greg KH <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
linux-kernel@...r.kernel.org,
Lino Sanfilippo <LinoSanfilippo@....de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH 01/36] serial: Add uart_rs485_config()
On Mon, Jun 06, 2022 at 01:03:58PM +0300, Ilpo Järvinen wrote:
> A few serial drivers make a call to rs485_config() themselves (all
> these seem to relate to init). Convert them all to use a common helper
> which makes it easy to make adjustments on tasks related to it as
> serial_rs485 struct sanitization is going to be added.
[...]
--- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1276,6 +1276,12 @@ static int uart_get_icount(struct tty_struct *tty,
> return 0;
> }
>
> +int uart_rs485_config(struct uart_port *port)
> +{
> + return port->rs485_config(port, &port->rs485);
> +}
> +EXPORT_SYMBOL_GPL(uart_rs485_config);
Why doesn't this helper acquire the port spinlock, unlike
uart_set_rs485_config()? Is this safe? Do all callers hold the lock?
Do we need an assertion to verify the lock is held?
Thanks,
Lukas
Powered by blists - more mailing lists