public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: "Vinod Koul" <vkoul@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Samuel Holland <samuel@sholland.org>,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH 46/59] dma: sun6i-dma: Convert to platform remove callback returning void
Date: Tue, 19 Sep 2023 19:22:03 +0200	[thread overview]
Message-ID: <13354858.uLZWGnKmhe@jernej-laptop> (raw)
In-Reply-To: <20230919133207.1400430-47-u.kleine-koenig@pengutronix.de>

Dne torek, 19. september 2023 ob 15:31:54 CEST je Uwe Kleine-König napisal(a):
> 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() is 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: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/dma/sun6i-dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
> index 2469efddf540..583bf49031cf 100644
> --- a/drivers/dma/sun6i-dma.c
> +++ b/drivers/dma/sun6i-dma.c
> @@ -1470,7 +1470,7 @@ static int sun6i_dma_probe(struct platform_device
> *pdev) return ret;
>  }
> 
> -static int sun6i_dma_remove(struct platform_device *pdev)
> +static void sun6i_dma_remove(struct platform_device *pdev)
>  {
>  	struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev);
> 
> @@ -1484,13 +1484,11 @@ static int sun6i_dma_remove(struct platform_device
> *pdev) reset_control_assert(sdc->rstc);
> 
>  	sun6i_dma_free(sdc);
> -
> -	return 0;
>  }
> 
>  static struct platform_driver sun6i_dma_driver = {
>  	.probe		= sun6i_dma_probe,
> -	.remove		= sun6i_dma_remove,
> +	.remove_new	= sun6i_dma_remove,
>  	.driver = {
>  		.name		= "sun6i-dma",
>  		.of_match_table	= sun6i_dma_match,





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

  reply	other threads:[~2023-09-19 17:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 03/59] dma: at_hdmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 04/59] dma: at_xdmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 06/59] dma: bcm2835-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 18/59] dma: imx-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 19/59] dma: imx-sdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 22/59] dma: mediatek: mtk-cqdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 23/59] dma: mediatek: mtk-hsdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 24/59] dma: mediatek: mtk-uart-apdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 33/59] dma: pxa_dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-19 13:31 ` [PATCH 44/59] dma: st_fdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 45/59] dma: sun4i-dma: " Uwe Kleine-König
2023-09-19 17:21   ` Jernej Škrabec
2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
2023-09-19 17:22   ` Jernej Škrabec [this message]
2023-09-19 13:32 ` [PATCH 56/59] dma: xilinx: xdma: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 57/59] dma: xilinx: xilinx_dma: " Uwe Kleine-König
2023-09-22 11:36   ` Pandey, Radhey Shyam
2023-09-28  7:27     ` Uwe Kleine-König
2023-09-28  7:47       ` Vinod Koul
2023-09-19 13:32 ` [PATCH 58/59] dma: xilinx: xilinx_dpdma: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 59/59] dma: xilinx: zynqmp_dma: " Uwe Kleine-König

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=13354858.uLZWGnKmhe@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@kernel.org \
    --cc=wens@csie.org \
    /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