lkml.org 
[lkml]   [2022]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-06-25 22:22    [W:0.219 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site