linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Lee Jones <lee@kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	kernel@pengutronix.de
Subject: [PATCH 06/13] backlight: led_bl: Convert to platform remove callback returning void
Date: Wed,  8 Mar 2023 08:39:38 +0100	[thread overview]
Message-ID: <20230308073945.2336302-7-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20230308073945.2336302-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/video/backlight/led_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c
index f54d256e2d54..a1b6a2ad73a0 100644
--- a/drivers/video/backlight/led_bl.c
+++ b/drivers/video/backlight/led_bl.c
@@ -217,7 +217,7 @@ static int led_bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int led_bl_remove(struct platform_device *pdev)
+static void led_bl_remove(struct platform_device *pdev)
 {
 	struct led_bl_data *priv = platform_get_drvdata(pdev);
 	struct backlight_device *bl = priv->bl_dev;
@@ -228,8 +228,6 @@ static int led_bl_remove(struct platform_device *pdev)
 	led_bl_power_off(priv);
 	for (i = 0; i < priv->nb_leds; i++)
 		led_sysfs_enable(priv->leds[i]);
-
-	return 0;
 }
 
 static const struct of_device_id led_bl_of_match[] = {
@@ -245,7 +243,7 @@ static struct platform_driver led_bl_driver = {
 		.of_match_table	= of_match_ptr(led_bl_of_match),
 	},
 	.probe		= led_bl_probe,
-	.remove		= led_bl_remove,
+	.remove_new	= led_bl_remove,
 };
 
 module_platform_driver(led_bl_driver);
-- 
2.39.1


  parent reply	other threads:[~2023-03-08  7:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
2023-03-16 13:47   ` Lee Jones
2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
2023-03-08  7:45   ` Hennerich, Michael
2023-03-16 13:47   ` Lee Jones
2023-03-08  7:39 ` [PATCH 03/13] backlight: cr_bllcd: " Uwe Kleine-König
2023-03-16 13:48   ` Lee Jones
2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
2023-03-08  9:23   ` DLG Adam Ward
2023-03-16 13:48   ` Lee Jones
2023-03-08  7:39 ` [PATCH 05/13] backlight: hp680_bl: " Uwe Kleine-König
2023-03-16 13:49   ` Lee Jones
2023-03-08  7:39 ` Uwe Kleine-König [this message]
2023-03-16 13:49   ` [PATCH 06/13] backlight: led_bl: " Lee Jones
2023-03-08  7:39 ` [PATCH 07/13] backlight: lm3533_bl: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 08/13] backlight: lp8788_bl: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 09/13] backlight: mt6370-backlight: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 10/13] backlight: pwm_bl: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 11/13] backlight: qcom-wled: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 12/13] backlight: rt4831-backlight: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 13/13] backlight: sky81452-backlight: " Uwe Kleine-König
2023-03-16 13:52   ` Lee Jones
2023-03-08 12:04 ` [PATCH 00/13] backlight: " Daniel Thompson

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=20230308073945.2336302-7-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.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).