linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>
Cc: AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	dri-devel@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org, kernel@pengutronix.de,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 28/53] drm/mediatek: Convert to platform remove callback returning void
Date: Mon, 8 May 2023 10:25:46 +0200	[thread overview]
Message-ID: <7aa7aca9-aa50-209a-fefd-a0792540aceb@gmail.com> (raw)
In-Reply-To: <20230507162616.1368908-29-u.kleine-koenig@pengutronix.de>



On 07/05/2023 18:25, Uwe Kleine-König wrote:
> 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 (mostly) ignored
> 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.
> 
> 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>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/gpu/drm/mediatek/mtk_cec.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c
> index b640bc0559e7..f47f417d8ba6 100644
> --- a/drivers/gpu/drm/mediatek/mtk_cec.c
> +++ b/drivers/gpu/drm/mediatek/mtk_cec.c
> @@ -235,13 +235,12 @@ static int mtk_cec_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int mtk_cec_remove(struct platform_device *pdev)
> +static void mtk_cec_remove(struct platform_device *pdev)
>   {
>   	struct mtk_cec *cec = platform_get_drvdata(pdev);
>   
>   	mtk_cec_htplg_irq_disable(cec);
>   	clk_disable_unprepare(cec->clk);
> -	return 0;
>   }
>   
>   static const struct of_device_id mtk_cec_of_ids[] = {
> @@ -252,7 +251,7 @@ MODULE_DEVICE_TABLE(of, mtk_cec_of_ids);
>   
>   struct platform_driver mtk_cec_driver = {
>   	.probe = mtk_cec_probe,
> -	.remove = mtk_cec_remove,
> +	.remove_new = mtk_cec_remove,
>   	.driver = {
>   		.name = "mediatek-cec",
>   		.of_match_table = mtk_cec_of_ids,


  reply	other threads:[~2023-05-08  8:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07 16:25 [PATCH 00/53] drm: Convert to platform remove callback returning void Uwe Kleine-König
2023-05-07 16:25 ` [PATCH 28/53] drm/mediatek: " Uwe Kleine-König
2023-05-08  8:25   ` Matthias Brugger [this message]
2023-05-07 16:25 ` [PATCH 29/53] " Uwe Kleine-König
2023-05-08  8:26   ` Matthias Brugger
2023-05-08  7:06 ` [PATCH 00/53] drm: " Thomas Zimmermann
2023-05-08  7:50   ` Uwe Kleine-König
2023-05-15  7:50 ` Inki Dae
2023-05-15  9:20   ` Uwe Kleine-König
2023-09-09 14:37 ` Javier Martinez Canillas

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=7aa7aca9-aa50-209a-fefd-a0792540aceb@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --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).