All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gmeiner <christian.gmeiner@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	The etnaviv authors <etnaviv@lists.freedesktop.org>,
	DRI mailing list <dri-devel@lists.freedesktop.org>,
	Russell King <linux+etnaviv@armlinux.org.uk>,
	Jyri Sarha <jyri.sarha@iki.fi>
Subject: Re: [PATCH v2 02/12] drm/etnaviv: Convert to platform remove callback returning void
Date: Sat, 9 Sep 2023 20:49:35 +0200	[thread overview]
Message-ID: <CAH9NwWdzVPrZD3Uo04fWXR0Cv=okK+P+njAR81gprCxKqp5icw@mail.gmail.com> (raw)
In-Reply-To: <20230801110239.831099-3-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 3077 bytes --]

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> schrieb am Di., 1. Aug.
2023, 13:02:

> 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 the etnaviv drm driver from always returning zero in
> the remove callback to the void returning variant.
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>


Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>



---
>  drivers/gpu/drm/etnaviv/etnaviv_drv.c | 6 ++----
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++---
>  2 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index ea55f6b7b744..20305df01b57 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -638,16 +638,14 @@ static int etnaviv_pdev_probe(struct platform_device
> *pdev)
>         return component_master_add_with_match(dev, &etnaviv_master_ops,
> match);
>  }
>
> -static int etnaviv_pdev_remove(struct platform_device *pdev)
> +static void etnaviv_pdev_remove(struct platform_device *pdev)
>  {
>         component_master_del(&pdev->dev, &etnaviv_master_ops);
> -
> -       return 0;
>  }
>
>  static struct platform_driver etnaviv_platform_driver = {
>         .probe      = etnaviv_pdev_probe,
> -       .remove     = etnaviv_pdev_remove,
> +       .remove_new = etnaviv_pdev_remove,
>         .driver     = {
>                 .name   = "etnaviv",
>         },
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index bbc9c54871f4..43426ffe4d77 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1892,11 +1892,10 @@ static int etnaviv_gpu_platform_probe(struct
> platform_device *pdev)
>         return 0;
>  }
>
> -static int etnaviv_gpu_platform_remove(struct platform_device *pdev)
> +static void etnaviv_gpu_platform_remove(struct platform_device *pdev)
>  {
>         component_del(&pdev->dev, &gpu_ops);
>         pm_runtime_disable(&pdev->dev);
> -       return 0;
>  }
>
>  static int etnaviv_gpu_rpm_suspend(struct device *dev)
> @@ -1954,6 +1953,6 @@ struct platform_driver etnaviv_gpu_driver = {
>                 .of_match_table = etnaviv_gpu_match,
>         },
>         .probe = etnaviv_gpu_platform_probe,
> -       .remove = etnaviv_gpu_platform_remove,
> +       .remove_new = etnaviv_gpu_platform_remove,
>         .id_table = gpu_ids,
>  };
> --
> 2.39.2
>
>

[-- Attachment #2: Type: text/html, Size: 4251 bytes --]

  reply	other threads:[~2023-09-09 18:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 11:02 [Nouveau] [PATCH v2 00/12] drm: Convert to platform remove callback returning void Uwe Kleine-König
2023-08-01 11:02 ` Uwe Kleine-König
2023-08-01 11:02 ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 01/12] drm/armada: " Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 02/12] drm/etnaviv: " Uwe Kleine-König
2023-09-09 18:49   ` Christian Gmeiner [this message]
2023-08-01 11:02 ` [PATCH v2 03/12] drm/imx/dcss: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 04/12] drm/imx/ipuv3: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 05/12] drm/ingenic: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 06/12] drm/kmb: " Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 07/12] drm/mediatek: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 12:59   ` AngeloGioacchino Del Regno
2023-08-01 12:59     ` AngeloGioacchino Del Regno
2023-08-01 12:59     ` AngeloGioacchino Del Regno
2023-08-01 11:02 ` [PATCH v2 08/12] drm/msm: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [Nouveau] [PATCH v2 09/12] drm/nouveau: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 10/12] drm/shmobile: " Uwe Kleine-König
2023-08-01 11:02   ` Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 11/12] drm/sprd: " Uwe Kleine-König
2023-08-01 11:02 ` [PATCH v2 12/12] drm/arcpgu: " 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='CAH9NwWdzVPrZD3Uo04fWXR0Cv=okK+P+njAR81gprCxKqp5icw@mail.gmail.com' \
    --to=christian.gmeiner@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=jyri.sarha@iki.fi \
    --cc=kernel@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.