Commit d5b3d02d authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman
Browse files

serial: Make uart_remove_one_port() return void



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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230512173810.131447-3-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bd6cd29
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -3006,14 +3006,13 @@ static int atmel_serial_remove(struct platform_device *pdev)
{
	struct uart_port *port = platform_get_drvdata(pdev);
	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
	int ret = 0;

	tasklet_kill(&atmel_port->tasklet_rx);
	tasklet_kill(&atmel_port->tasklet_tx);

	device_init_wakeup(&pdev->dev, 0);

	ret = uart_remove_one_port(&atmel_uart, port);
	uart_remove_one_port(&atmel_uart, port);

	kfree(atmel_port->rx_ring.buf);

@@ -3023,7 +3022,7 @@ static int atmel_serial_remove(struct platform_device *pdev)

	pdev->dev.of_node = NULL;

	return ret;
	return 0;
}

static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
+3 −1
Original line number Diff line number Diff line
@@ -514,7 +514,9 @@ static int uart_clps711x_remove(struct platform_device *pdev)
{
	struct clps711x_port *s = platform_get_drvdata(pdev);

	return uart_remove_one_port(&clps711x_uart, &s->port);
	uart_remove_one_port(&clps711x_uart, &s->port);

	return 0;
}

static const struct of_device_id __maybe_unused clps711x_uart_dt_ids[] = {
+4 −1
Original line number Diff line number Diff line
@@ -1431,7 +1431,10 @@ static int cpm_uart_probe(struct platform_device *ofdev)
static int cpm_uart_remove(struct platform_device *ofdev)
{
	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
	return uart_remove_one_port(&cpm_reg, &pinfo->port);

	uart_remove_one_port(&cpm_reg, &pinfo->port);

	return 0;
}

static const struct of_device_id cpm_uart_match[] = {
+3 −1
Original line number Diff line number Diff line
@@ -2467,7 +2467,9 @@ static int imx_uart_remove(struct platform_device *pdev)
{
	struct imx_port *sport = platform_get_drvdata(pdev);

	return uart_remove_one_port(&imx_uart_uart_driver, &sport->port);
	uart_remove_one_port(&imx_uart_uart_driver, &sport->port);

	return 0;
}

static void imx_uart_restore_context(struct imx_port *sport)
+3 −1
Original line number Diff line number Diff line
@@ -889,7 +889,9 @@ static int lqasc_remove(struct platform_device *pdev)
{
	struct uart_port *port = platform_get_drvdata(pdev);

	return uart_remove_one_port(&lqasc_reg, port);
	uart_remove_one_port(&lqasc_reg, port);

	return 0;
}

static const struct ltq_soc_data soc_data_lantiq = {
Loading