dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jonas Karlman <jonas@kwiboo.se>
Subject: [PATCH 19/19] drm/bridge: ti-tfp410: Convert to platform remove callback returning void
Date: Sat, 18 Mar 2023 20:08:04 +0100	[thread overview]
Message-ID: <20230318190804.234610-20-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20230318190804.234610-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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/bridge/ti-tfp410.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index 6db69df0e18b..ab63225cd635 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -355,11 +355,9 @@ static int tfp410_probe(struct platform_device *pdev)
 	return tfp410_init(&pdev->dev, false);
 }
 
-static int tfp410_remove(struct platform_device *pdev)
+static void tfp410_remove(struct platform_device *pdev)
 {
 	tfp410_fini(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id tfp410_match[] = {
@@ -370,7 +368,7 @@ MODULE_DEVICE_TABLE(of, tfp410_match);
 
 static struct platform_driver tfp410_platform_driver = {
 	.probe	= tfp410_probe,
-	.remove	= tfp410_remove,
+	.remove_new = tfp410_remove,
 	.driver	= {
 		.name		= "tfp410-bridge",
 		.of_match_table	= tfp410_match,
-- 
2.39.2


  parent reply	other threads:[~2023-03-18 19:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18 19:07 [PATCH 00/19] drm/bridge: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 01/19] drm/bridge: cdns-mhdp8546: Improve error reporting in remove callback Uwe Kleine-König
2023-03-19 13:13   ` Laurent Pinchart
2023-03-19 13:59     ` Uwe Kleine-König
2023-03-19 17:41       ` Laurent Pinchart
2023-03-18 19:07 ` [PATCH 02/19] drm/bridge: cdns-dsi: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 03/19] drm/bridge: cdns-mhdp8546: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 04/19] drm/bridge: display-connector: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 05/19] drm/bridge: fsl-ldb: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 06/19] drm/bridge: imx8qm-ldb: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 07/19] drm/bridge: imx8qxp-ldb: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 08/19] drm/bridge: imx8qxp-pixel-combiner: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 09/19] drm/bridge: imx8qxp-pixel-link: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 10/19] drm/bridge: imx8qxp-pxl2dpi: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 11/19] drm/bridge: lvds-codec: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 12/19] drm/bridge: nwl-dsi: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 13/19] drm/bridge: simple-bridg: " Uwe Kleine-König
2023-03-18 19:07 ` [PATCH 14/19] drm/bridge: dw-hdmi-ahb-audio: " Uwe Kleine-König
2023-03-18 19:08 ` [PATCH 15/19] drm/bridge: dw-hdmi-cec: " Uwe Kleine-König
2023-03-18 19:08 ` [PATCH 16/19] drm/bridge: dw-hdmi-gp-audio: " Uwe Kleine-König
2023-03-18 19:08 ` [PATCH 17/19] drm/bridge: dw-hdmi-i2s-audio: " Uwe Kleine-König
2023-03-18 19:08 ` [PATCH 18/19] drm/bridge: thc63lvd1024: " Uwe Kleine-König
2023-03-18 19:08 ` Uwe Kleine-König [this message]
2023-03-19 13:14 ` [PATCH 00/19] drm/bridge: " Laurent Pinchart
2023-03-20 10:54 ` (subset) " Neil Armstrong
2023-05-09  6:07   ` 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=20230318190804.234610-20-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.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;
as well as URLs for NNTP newsgroup(s).