mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Coster <Matt.Coster@imgtec.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	"Frank Binns" <Frank.Binns@imgtec.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] drm/imagination: Convert to platform remove callback returning void
Date: Tue, 23 Apr 2024 08:29:29 +0000	[thread overview]
Message-ID: <bd37ff0d-9f99-4993-b198-af82a98fa1e4@imgtec.com> (raw)
In-Reply-To: <4cf10e420863f40a268f26b9bdb0c4b53dbf3406.1712681770.git.u.kleine-koenig@pengutronix.de>


[-- Attachment #1.1.1: Type: text/plain, Size: 2114 bytes --]

On 09/04/2024 18:02, 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 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: Matt Coster <matt.coster@imgtec.com>

> ---
>  drivers/gpu/drm/imagination/pvr_drv.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c
> index 5c3b2d58d766..1a0cb7aa9cea 100644
> --- a/drivers/gpu/drm/imagination/pvr_drv.c
> +++ b/drivers/gpu/drm/imagination/pvr_drv.c
> @@ -1451,8 +1451,7 @@ pvr_probe(struct platform_device *plat_dev)
>  	return err;
>  }
>  
> -static int
> -pvr_remove(struct platform_device *plat_dev)
> +static void pvr_remove(struct platform_device *plat_dev)
>  {
>  	struct drm_device *drm_dev = platform_get_drvdata(plat_dev);
>  	struct pvr_device *pvr_dev = to_pvr_device(drm_dev);
> @@ -1469,8 +1468,6 @@ pvr_remove(struct platform_device *plat_dev)
>  	pvr_watchdog_fini(pvr_dev);
>  	pvr_queue_device_fini(pvr_dev);
>  	pvr_context_device_fini(pvr_dev);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id dt_match[] = {
> @@ -1485,7 +1482,7 @@ static const struct dev_pm_ops pvr_pm_ops = {
>  
>  static struct platform_driver pvr_driver = {
>  	.probe = pvr_probe,
> -	.remove = pvr_remove,
> +	.remove_new = pvr_remove,
>  	.driver = {
>  		.name = PVR_DRIVER_NAME,
>  		.pm = &pvr_pm_ops,

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 1817 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  parent reply	other threads:[~2024-04-23  8:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 17:02 [PATCH 0/4] gpu: " Uwe Kleine-König
2024-04-09 17:02 ` [PATCH 1/4] drm/imagination: " Uwe Kleine-König
2024-04-16 19:15   ` Matt Coster
2024-04-23  8:29   ` Matt Coster [this message]
2024-04-09 17:02 ` [PATCH 2/4] drm/mediatek: " Uwe Kleine-König
2024-05-16  2:54   ` CK Hu (胡俊光)
2024-05-16 10:12   ` AngeloGioacchino Del Regno
2024-04-09 17:02 ` [PATCH 3/4] gpu: host1x: " Uwe Kleine-König
2024-04-19 11:29   ` Thierry Reding
2024-04-09 17:02 ` [PATCH 4/4] gpu: ipu-v3: " Uwe Kleine-König
2024-04-10  8:29   ` Philipp Zabel
2024-04-09 17:10 ` [PATCH 0/4] gpu: " Uwe Kleine-König
2024-04-09 18:59 ` Thomas Zimmermann
2024-04-19  7:20 ` Uwe Kleine-König
2024-04-19 11:28   ` Thierry Reding
2024-04-23  8:31   ` Matt Coster

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=bd37ff0d-9f99-4993-b198-af82a98fa1e4@imgtec.com \
    --to=matt.coster@imgtec.com \
    --cc=Frank.Binns@imgtec.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.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

all inboxes | Powered by JetHome®