linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Genoud <richard.genoud@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	kernel@pengutronix.de, Richard Genoud <richard.genoud@gmail.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 08/52] serial: atmel: Convert to platform remove callback returning void
Date: Mon, 13 Nov 2023 17:22:26 +0100	[thread overview]
Message-ID: <a098b0e0-fd8f-4fc8-a246-43a740aa8539@gmail.com> (raw)
In-Reply-To: <20231110152927.70601-9-u.kleine-koenig@pengutronix.de>



Le 10/11/2023 à 16:29, Uwe Kleine-König a écrit :
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> 
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> ---
>   drivers/tty/serial/atmel_serial.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 1946fafc3f3e..6792680690bd 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -3001,7 +3001,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
>    * protocol that needs bitbanging on IO lines, but use the regular serial
>    * port in the normal case.
>    */
> -static int atmel_serial_remove(struct platform_device *pdev)
> +static void 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);
> @@ -3020,8 +3020,6 @@ static int atmel_serial_remove(struct platform_device *pdev)
>   	clear_bit(port->line, atmel_ports_in_use);
>   
>   	pdev->dev.of_node = NULL;
> -
> -	return 0;
>   }
>   
>   static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
> @@ -3029,7 +3027,7 @@ static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
>   
>   static struct platform_driver atmel_serial_driver = {
>   	.probe		= atmel_serial_probe,
> -	.remove		= atmel_serial_remove,
> +	.remove_new	= atmel_serial_remove,
>   	.driver		= {
>   		.name			= "atmel_usart_serial",
>   		.of_match_table		= of_match_ptr(atmel_serial_dt_ids),

Thanks !

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

  parent reply	other threads:[~2023-11-13 16:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231110152927.70601-1-u.kleine-koenig@pengutronix.de>
2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void Uwe Kleine-König
2023-11-10 17:49   ` Florian Fainelli
2023-11-13  9:09   ` AngeloGioacchino Del Regno
2023-11-13 10:15   ` Geert Uytterhoeven
2023-11-22 23:23   ` Andi Shyti
2023-11-10 15:29 ` [PATCH 08/52] serial: atmel: " Uwe Kleine-König
2023-11-10 18:09   ` claudiu beznea
2023-11-13 16:22   ` Richard Genoud [this message]
2023-11-10 15:29 ` [PATCH 10/52] serial: clps711x: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 12/52] serial: digicolor: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 17/52] serial: imx: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 20/52] serial: lpc32xx_hs: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 21/52] serial: ma35d1: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 23/52] serial: meson: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 24/52] serial: milbeaut_usio: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 27/52] serial: mxs-auart: " Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 29/52] serial: owl: " Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 32/52] serial: rda: " Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 34/52] serial: samsung: " Uwe Kleine-König
2023-11-12  7:48   ` Krzysztof Kozlowski
2023-11-12  9:09     ` Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 41/52] serial: st-asc: " Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 42/52] serial: stm32: " Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 52/52] serial: xilinx_uartps: " Uwe Kleine-König
2023-11-13  9:41   ` Michal Simek
2023-11-13 10:03     ` Uwe Kleine-König
2023-11-13 14:31       ` Greg Kroah-Hartman

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=a098b0e0-fd8f-4fc8-a246-43a740aa8539@gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).