[PATCH 2/2] serial: Make uart_remove_one_port() return void

Patrice CHOTARD patrice.chotard at foss.st.com
Mon May 15 00:11:36 PDT 2023


Hi

On 5/12/23 19:38, Uwe Kleine-König wrote:
> The return value is only ever used as a return value for remove callbacks
> of platform drivers. This return value is ignored by the driver core.
> (The only effect is an error message, but uart_remove_one_port() already
> emitted one in this case.)
> 
> So the return value isn't used at all and uart_remove_one_port() can be
> changed to return void without any loss. Also this better matches the
> Linux device model as remove functions are not supposed to fail.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  drivers/tty/serial/atmel_serial.c           |  5 ++---
>  drivers/tty/serial/clps711x.c               |  4 +++-
>  drivers/tty/serial/cpm_uart/cpm_uart_core.c |  5 ++++-
>  drivers/tty/serial/imx.c                    |  4 +++-
>  drivers/tty/serial/lantiq.c                 |  4 +++-
>  drivers/tty/serial/serial_core.c            |  6 +-----
>  drivers/tty/serial/st-asc.c                 |  4 +++-
>  drivers/tty/serial/uartlite.c               | 12 ++++--------
>  drivers/tty/serial/xilinx_uartps.c          |  5 ++---
>  include/linux/serial_core.h                 |  2 +-
>  10 files changed, 26 insertions(+), 25 deletions(-)

> diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
> index 5215e6910f68..dc2f2051435c 100644
> --- a/drivers/tty/serial/st-asc.c
> +++ b/drivers/tty/serial/st-asc.c
> @@ -796,7 +796,9 @@ static int asc_serial_remove(struct platform_device *pdev)
>  {
>  	struct uart_port *port = platform_get_drvdata(pdev);
>  
> -	return uart_remove_one_port(&asc_uart_driver, port);
> +	uart_remove_one_port(&asc_uart_driver, port);
> +
> +	return 0;
>  }
>  
>  #ifdef CONFIG_PM_SLEEP

For st-asc:  
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice



More information about the linux-arm-kernel mailing list