All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Edmund Dea <edmund.j.dea@intel.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	kernel@pengutronix.de, dri-devel@lists.freedesktop.org
Subject: [PATCH v2 06/12] drm/kmb: Convert to platform remove callback returning void
Date: Tue,  1 Aug 2023 13:02:33 +0200	[thread overview]
Message-ID: <20230801110239.831099-7-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20230801110239.831099-1-u.kleine-koenig@pengutronix.de>

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.

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>
---
 drivers/gpu/drm/kmb/kmb_drv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index 24035b53441c..169b83987ce2 100644
--- a/drivers/gpu/drm/kmb/kmb_drv.c
+++ b/drivers/gpu/drm/kmb/kmb_drv.c
@@ -448,7 +448,7 @@ static const struct drm_driver kmb_driver = {
 	.minor = DRIVER_MINOR,
 };
 
-static int kmb_remove(struct platform_device *pdev)
+static void kmb_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct drm_device *drm = dev_get_drvdata(dev);
@@ -473,7 +473,6 @@ static int kmb_remove(struct platform_device *pdev)
 	/* Unregister DSI host */
 	kmb_dsi_host_unregister(kmb->kmb_dsi);
 	drm_atomic_helper_shutdown(drm);
-	return 0;
 }
 
 static int kmb_probe(struct platform_device *pdev)
@@ -621,7 +620,7 @@ static SIMPLE_DEV_PM_OPS(kmb_pm_ops, kmb_pm_suspend, kmb_pm_resume);
 
 static struct platform_driver kmb_platform_driver = {
 	.probe = kmb_probe,
-	.remove = kmb_remove,
+	.remove_new = kmb_remove,
 	.driver = {
 		.name = "kmb-drm",
 		.pm = &kmb_pm_ops,
-- 
2.39.2


  parent reply	other threads:[~2023-08-01 11:03 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
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 ` Uwe Kleine-König [this message]
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=20230801110239.831099-7-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=airlied@gmail.com \
    --cc=anitha.chrisanthus@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edmund.j.dea@intel.com \
    --cc=jyri.sarha@iki.fi \
    --cc=kernel@pengutronix.de \
    --cc=tzimmermann@suse.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.