linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/52] input: Convert to platform remove callback returning void
@ 2023-09-20 12:57 Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 01/52] input: adp5520-keys - " Uwe Kleine-König
                   ` (54 more replies)
  0 siblings, 55 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Michael Hennerich, linux-input, kernel, Benson Leung,
	Guenter Roeck, Greg Kroah-Hartman, Jonathan Cameron,
	joewu (吳仲振), chrome-platform,
	Andy Shevchenko, Mattijs Korpershoek, Jeff LaBundy, Rob Herring,
	Siarhei Volkau, Pavel Machek, Steven Rostedt (Google),
	Paolo Abeni, Kalle Valo, Yangtao Li, ye xingchen, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel,
	Support Opensource, Andrey Moiseev, Lee Jones, Linus Walleij,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Hans de Goede, Miloslav Trmac, patches, Christophe JAILLET,
	Liang He, Chen Jun, Ruan Jinjie, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, linux-sunxi, Michal Simek, Robert Jarzmik,
	Dmitry Baryshkov, Arnd Bergmann, Rafael J. Wysocki,
	Krzysztof Kozlowski, Daniel Lezcano, Jonathan Corbet

Hello,

this series converts all platform drivers below drivers/input to use
remove_new. The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply or a subject prefix is suboptimal, please apply the remainder of
this series anyhow.

Best regards
Uwe

Uwe Kleine-König (52):
  input: adp5520-keys - Convert to platform remove callback returning
    void
  input: cros_ec_keyb - Convert to platform remove callback returning
    void
  input: ep93xx_keypad - Convert to platform remove callback returning
    void
  input: iqs62x-keys - Convert to platform remove callback returning
    void
  input: matrix_keypad - Convert to platform remove callback returning
    void
  input: omap-keypad - Convert to platform remove callback returning
    void
  input: omap4-keypad - Convert to platform remove callback returning
    void
  input: samsung-keypad - Convert to platform remove callback returning
    void
  input: sh_keysc - Convert to platform remove callback returning void
  input: spear-keyboard - Convert to platform remove callback returning
    void
  input: stmpe-keypad - Convert to platform remove callback returning
    void
  input: 88pm80x_onkey - Convert to platform remove callback returning
    void
  input: da9052_onkey - Convert to platform remove callback returning
    void
  input: da9055_onkey - Convert to platform remove callback returning
    void
  input: ideapad_slidebar - Convert to platform remove callback
    returning void
  input: m68kspkr - Convert to platform remove callback returning void
  input: max8997_haptic - Convert to platform remove callback returning
    void
  input: mc13783-pwrbutton - Convert to platform remove callback
    returning void
  input: palmas-pwrbutton - Convert to platform remove callback
    returning void
  input: pcap_keys - Convert to platform remove callback returning void
  input: pcf50633-input - Convert to platform remove callback returning
    void
  input: pcspkr - Convert to platform remove callback returning void
  input: pm8941-pwrkey - Convert to platform remove callback returning
    void
  input: soc_button_array - Convert to platform remove callback
    returning void
  input: sparcspkr - Convert to platform remove callback returning void
  input: wistron_btns - Convert to platform remove callback returning
    void
  input: wm831x-on - Convert to platform remove callback returning void
  input: navpoint - Convert to platform remove callback returning void
  input: altera_ps2 - Convert to platform remove callback returning void
  input: ams_delta_serio - Convert to platform remove callback returning
    void
  input: apbps2 - Convert to platform remove callback returning void
  input: arc_ps2 - Convert to platform remove callback returning void
  input: ct82c710 - Convert to platform remove callback returning void
  drivers/input/serio/i8042-sparcio.h :: Convert to platform remove
    callback returning void
  input: i8042 - Convert to platform remove callback returning void
  input: ioc3kbd - Convert to platform remove callback returning void
  input: maceps2 - Convert to platform remove callback returning void
  input: olpc_apsp - Convert to platform remove callback returning void
  input: ps2-gpio - Convert to platform remove callback returning void
  input: q40kbd - Convert to platform remove callback returning void
  input: rpckbd - Convert to platform remove callback returning void
  input: sun4i-ps2 - Convert to platform remove callback returning void
  input: xilinx_ps2 - Convert to platform remove callback returning void
  input: da9052_tsi - Convert to platform remove callback returning void
  input: mainstone-wm97xx - Convert to platform remove callback
    returning void
  input: mc13783_ts - Convert to platform remove callback returning void
  input: pcap_ts - Convert to platform remove callback returning void
  input: stmpe-ts - Convert to platform remove callback returning void
  input: sun4i-ts - Convert to platform remove callback returning void
  input: ti_am335x_tsc - Convert to platform remove callback returning
    void
  input: wm831x-ts - Convert to platform remove callback returning void
  input: wm97xx-core - Convert to platform remove callback returning
    void

 drivers/input/keyboard/adp5520-keys.c        |  6 ++----
 drivers/input/keyboard/cros_ec_keyb.c        |  6 ++----
 drivers/input/keyboard/ep93xx_keypad.c       |  6 ++----
 drivers/input/keyboard/iqs62x-keys.c         |  6 ++----
 drivers/input/keyboard/matrix_keypad.c       |  6 ++----
 drivers/input/keyboard/omap-keypad.c         |  6 ++----
 drivers/input/keyboard/omap4-keypad.c        |  6 ++----
 drivers/input/keyboard/samsung-keypad.c      |  6 ++----
 drivers/input/keyboard/sh_keysc.c            |  6 ++----
 drivers/input/keyboard/spear-keyboard.c      |  6 ++----
 drivers/input/keyboard/stmpe-keypad.c        |  6 ++----
 drivers/input/misc/88pm80x_onkey.c           |  5 ++---
 drivers/input/misc/da9052_onkey.c            |  6 ++----
 drivers/input/misc/da9055_onkey.c            |  6 ++----
 drivers/input/misc/ideapad_slidebar.c        |  6 ++----
 drivers/input/misc/m68kspkr.c                |  6 ++----
 drivers/input/misc/max8997_haptic.c          |  6 ++----
 drivers/input/misc/mc13783-pwrbutton.c       |  6 ++----
 drivers/input/misc/palmas-pwrbutton.c        |  6 ++----
 drivers/input/misc/pcap_keys.c               |  6 ++----
 drivers/input/misc/pcf50633-input.c          |  6 ++----
 drivers/input/misc/pcspkr.c                  |  6 ++----
 drivers/input/misc/pm8941-pwrkey.c           |  6 ++----
 drivers/input/misc/soc_button_array.c        |  6 ++----
 drivers/input/misc/sparcspkr.c               | 12 ++++--------
 drivers/input/misc/wistron_btns.c            |  6 ++----
 drivers/input/misc/wm831x-on.c               |  6 ++----
 drivers/input/mouse/navpoint.c               |  6 ++----
 drivers/input/serio/altera_ps2.c             |  6 ++----
 drivers/input/serio/ams_delta_serio.c        |  6 ++----
 drivers/input/serio/apbps2.c                 |  6 ++----
 drivers/input/serio/arc_ps2.c                |  6 ++----
 drivers/input/serio/ct82c710.c               |  6 ++----
 drivers/input/serio/i8042-sparcio.h          |  6 ++----
 drivers/input/serio/i8042.c                  |  6 ++----
 drivers/input/serio/ioc3kbd.c                |  6 ++----
 drivers/input/serio/maceps2.c                |  6 ++----
 drivers/input/serio/olpc_apsp.c              |  6 ++----
 drivers/input/serio/ps2-gpio.c               |  5 ++---
 drivers/input/serio/q40kbd.c                 |  6 ++----
 drivers/input/serio/rpckbd.c                 |  6 ++----
 drivers/input/serio/sun4i-ps2.c              |  6 ++----
 drivers/input/serio/xilinx_ps2.c             |  6 ++----
 drivers/input/touchscreen/da9052_tsi.c       |  6 ++----
 drivers/input/touchscreen/mainstone-wm97xx.c |  6 ++----
 drivers/input/touchscreen/mc13783_ts.c       |  6 ++----
 drivers/input/touchscreen/pcap_ts.c          |  6 ++----
 drivers/input/touchscreen/stmpe-ts.c         |  6 ++----
 drivers/input/touchscreen/sun4i-ts.c         |  6 ++----
 drivers/input/touchscreen/ti_am335x_tsc.c    |  5 ++---
 drivers/input/touchscreen/wm831x-ts.c        |  6 ++----
 drivers/input/touchscreen/wm97xx-core.c      |  6 ++----
 52 files changed, 106 insertions(+), 209 deletions(-)

base-commit: 926f75c8a5ab70567eb4c2d82fbc96963313e564
-- 
2.40.1


^ permalink raw reply	[flat|nested] 67+ messages in thread

* [PATCH 01/52] input: adp5520-keys - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 02/52] input: cros_ec_keyb " Uwe Kleine-König
                   ` (53 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Michael Hennerich, linux-input, kernel

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>
---
 drivers/input/keyboard/adp5520-keys.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c
index 7851ffd678a8..10c248f0c1fc 100644
--- a/drivers/input/keyboard/adp5520-keys.c
+++ b/drivers/input/keyboard/adp5520-keys.c
@@ -168,14 +168,12 @@ static int adp5520_keys_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int adp5520_keys_remove(struct platform_device *pdev)
+static void adp5520_keys_remove(struct platform_device *pdev)
 {
 	struct adp5520_keys *dev = platform_get_drvdata(pdev);
 
 	adp5520_unregister_notifier(dev->master, &dev->notifier,
 				ADP5520_KP_IEN | ADP5520_KR_IEN);
-
-	return 0;
 }
 
 static struct platform_driver adp5520_keys_driver = {
@@ -183,7 +181,7 @@ static struct platform_driver adp5520_keys_driver = {
 		.name	= "adp5520-keys",
 	},
 	.probe		= adp5520_keys_probe,
-	.remove		= adp5520_keys_remove,
+	.remove_new	= adp5520_keys_remove,
 };
 module_platform_driver(adp5520_keys_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 02/52] input: cros_ec_keyb - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 01/52] input: adp5520-keys - " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-21  3:21   ` Tzung-Bi Shih
  2023-09-20 12:57 ` [PATCH 03/52] input: ep93xx_keypad " Uwe Kleine-König
                   ` (52 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Benson Leung, Guenter Roeck, Greg Kroah-Hartman, Jonathan Cameron,
	joewu (吳仲振), linux-input, chrome-platform,
	kernel

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>
---
 drivers/input/keyboard/cros_ec_keyb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 313b7a69dd69..30678a34cf64 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -743,14 +743,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int cros_ec_keyb_remove(struct platform_device *pdev)
+static void cros_ec_keyb_remove(struct platform_device *pdev)
 {
 	struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev);
 
 	blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
 					   &ckdev->notifier);
-
-	return 0;
 }
 
 #ifdef CONFIG_ACPI
@@ -774,7 +772,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
 
 static struct platform_driver cros_ec_keyb_driver = {
 	.probe = cros_ec_keyb_probe,
-	.remove = cros_ec_keyb_remove,
+	.remove_new = cros_ec_keyb_remove,
 	.driver = {
 		.name = "cros-ec-keyb",
 		.dev_groups = cros_ec_keyb_groups,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 03/52] input: ep93xx_keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 01/52] input: adp5520-keys - " Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 02/52] input: cros_ec_keyb " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 04/52] input: iqs62x-keys " Uwe Kleine-König
                   ` (51 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jonathan Cameron, Andy Shevchenko, linux-input, kernel

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>
---
 drivers/input/keyboard/ep93xx_keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 55075addcac2..6b811d6bf625 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -308,11 +308,9 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int ep93xx_keypad_remove(struct platform_device *pdev)
+static void ep93xx_keypad_remove(struct platform_device *pdev)
 {
 	dev_pm_clear_wake_irq(&pdev->dev);
-
-	return 0;
 }
 
 static struct platform_driver ep93xx_keypad_driver = {
@@ -321,7 +319,7 @@ static struct platform_driver ep93xx_keypad_driver = {
 		.pm	= pm_sleep_ptr(&ep93xx_keypad_pm_ops),
 	},
 	.probe		= ep93xx_keypad_probe,
-	.remove		= ep93xx_keypad_remove,
+	.remove_new	= ep93xx_keypad_remove,
 };
 module_platform_driver(ep93xx_keypad_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 04/52] input: iqs62x-keys - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 03/52] input: ep93xx_keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-21 11:29   ` Jeff LaBundy
  2023-09-20 12:57 ` [PATCH 05/52] input: matrix_keypad " Uwe Kleine-König
                   ` (50 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Mattijs Korpershoek, Jeff LaBundy, linux-input, kernel

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>
---
 drivers/input/keyboard/iqs62x-keys.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
index 02ceebad7bda..688d61244b5f 100644
--- a/drivers/input/keyboard/iqs62x-keys.c
+++ b/drivers/input/keyboard/iqs62x-keys.c
@@ -310,7 +310,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int iqs62x_keys_remove(struct platform_device *pdev)
+static void iqs62x_keys_remove(struct platform_device *pdev)
 {
 	struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
 	int ret;
@@ -319,8 +319,6 @@ static int iqs62x_keys_remove(struct platform_device *pdev)
 						 &iqs62x_keys->notifier);
 	if (ret)
 		dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret);
-
-	return 0;
 }
 
 static struct platform_driver iqs62x_keys_platform_driver = {
@@ -328,7 +326,7 @@ static struct platform_driver iqs62x_keys_platform_driver = {
 		.name = "iqs62x-keys",
 	},
 	.probe = iqs62x_keys_probe,
-	.remove = iqs62x_keys_remove,
+	.remove_new = iqs62x_keys_remove,
 };
 module_platform_driver(iqs62x_keys_platform_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 05/52] input: matrix_keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 04/52] input: iqs62x-keys " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 06/52] input: omap-keypad " Uwe Kleine-König
                   ` (49 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Rob Herring, Jonathan Cameron, Andy Shevchenko, Siarhei Volkau,
	linux-input, kernel

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>
---
 drivers/input/keyboard/matrix_keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index a1b037891af2..50fa764c82d2 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -549,15 +549,13 @@ static int matrix_keypad_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int matrix_keypad_remove(struct platform_device *pdev)
+static void matrix_keypad_remove(struct platform_device *pdev)
 {
 	struct matrix_keypad *keypad = platform_get_drvdata(pdev);
 
 	matrix_keypad_free_gpio(keypad);
 	input_unregister_device(keypad->input_dev);
 	kfree(keypad);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -570,7 +568,7 @@ MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match);
 
 static struct platform_driver matrix_keypad_driver = {
 	.probe		= matrix_keypad_probe,
-	.remove		= matrix_keypad_remove,
+	.remove_new	= matrix_keypad_remove,
 	.driver		= {
 		.name	= "matrix-keypad",
 		.pm	= pm_sleep_ptr(&matrix_keypad_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 06/52] input: omap-keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 05/52] input: matrix_keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 07/52] input: omap4-keypad " Uwe Kleine-König
                   ` (48 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Pavel Machek, Steven Rostedt (Google), Paolo Abeni, Kalle Valo,
	linux-input, kernel

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>
---
 drivers/input/keyboard/omap-keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 24440b498645..454fb8675657 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -287,7 +287,7 @@ static int omap_kp_probe(struct platform_device *pdev)
 	return -EINVAL;
 }
 
-static int omap_kp_remove(struct platform_device *pdev)
+static void omap_kp_remove(struct platform_device *pdev)
 {
 	struct omap_kp *omap_kp = platform_get_drvdata(pdev);
 
@@ -303,13 +303,11 @@ static int omap_kp_remove(struct platform_device *pdev)
 	input_unregister_device(omap_kp->input);
 
 	kfree(omap_kp);
-
-	return 0;
 }
 
 static struct platform_driver omap_kp_driver = {
 	.probe		= omap_kp_probe,
-	.remove		= omap_kp_remove,
+	.remove_new	= omap_kp_remove,
 	.driver		= {
 		.name	= "omap-keypad",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 07/52] input: omap4-keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 06/52] input: omap-keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 08/52] input: samsung-keypad " Uwe Kleine-König
                   ` (47 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Yangtao Li, Jonathan Cameron, Rob Herring, linux-input, kernel

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>
---
 drivers/input/keyboard/omap4-keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 773e55eed88b..d3f8688fdd9c 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -461,11 +461,9 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap4_keypad_remove(struct platform_device *pdev)
+static void omap4_keypad_remove(struct platform_device *pdev)
 {
 	dev_pm_clear_wake_irq(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id omap_keypad_dt_match[] = {
@@ -476,7 +474,7 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match);
 
 static struct platform_driver omap4_keypad_driver = {
 	.probe		= omap4_keypad_probe,
-	.remove		= omap4_keypad_remove,
+	.remove_new	= omap4_keypad_remove,
 	.driver		= {
 		.name	= "omap4-keypad",
 		.of_match_table = omap_keypad_dt_match,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 08/52] input: samsung-keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 07/52] input: omap4-keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 09/52] input: sh_keysc " Uwe Kleine-König
                   ` (46 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rob Herring, Jonathan Cameron, linux-input, kernel

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>
---
 drivers/input/keyboard/samsung-keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index d85dd2489293..e212eff7687c 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -444,7 +444,7 @@ static int samsung_keypad_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int samsung_keypad_remove(struct platform_device *pdev)
+static void samsung_keypad_remove(struct platform_device *pdev)
 {
 	struct samsung_keypad *keypad = platform_get_drvdata(pdev);
 
@@ -453,8 +453,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
 	input_unregister_device(keypad->input_dev);
 
 	clk_unprepare(keypad->clk);
-
-	return 0;
 }
 
 static int samsung_keypad_runtime_suspend(struct device *dev)
@@ -589,7 +587,7 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids);
 
 static struct platform_driver samsung_keypad_driver = {
 	.probe		= samsung_keypad_probe,
-	.remove		= samsung_keypad_remove,
+	.remove_new	= samsung_keypad_remove,
 	.driver		= {
 		.name	= "samsung-keypad",
 		.of_match_table = of_match_ptr(samsung_keypad_dt_match),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 09/52] input: sh_keysc - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 08/52] input: samsung-keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 10/52] input: spear-keyboard " Uwe Kleine-König
                   ` (45 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jonathan Cameron, linux-input, kernel

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>
---
 drivers/input/keyboard/sh_keysc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index 2c00320f739f..4ea4fd25c5d2 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -265,7 +265,7 @@ static int sh_keysc_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int sh_keysc_remove(struct platform_device *pdev)
+static void sh_keysc_remove(struct platform_device *pdev)
 {
 	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
 
@@ -279,8 +279,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	kfree(priv);
-
-	return 0;
 }
 
 static int sh_keysc_suspend(struct device *dev)
@@ -321,7 +319,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
 
 static struct platform_driver sh_keysc_device_driver = {
 	.probe		= sh_keysc_probe,
-	.remove		= sh_keysc_remove,
+	.remove_new	= sh_keysc_remove,
 	.driver		= {
 		.name	= "sh_keysc",
 		.pm	= pm_sleep_ptr(&sh_keysc_dev_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 10/52] input: spear-keyboard - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 09/52] input: sh_keysc " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 11/52] input: stmpe-keypad " Uwe Kleine-König
                   ` (44 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ye xingchen, Jonathan Cameron, linux-input, kernel

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>
---
 drivers/input/keyboard/spear-keyboard.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index a50fa9915381..557d00a667ce 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -272,14 +272,12 @@ static int spear_kbd_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int spear_kbd_remove(struct platform_device *pdev)
+static void spear_kbd_remove(struct platform_device *pdev)
 {
 	struct spear_kbd *kbd = platform_get_drvdata(pdev);
 
 	input_unregister_device(kbd->input);
 	clk_unprepare(kbd->clk);
-
-	return 0;
 }
 
 static int spear_kbd_suspend(struct device *dev)
@@ -375,7 +373,7 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table);
 
 static struct platform_driver spear_kbd_driver = {
 	.probe		= spear_kbd_probe,
-	.remove		= spear_kbd_remove,
+	.remove_new	= spear_kbd_remove,
 	.driver		= {
 		.name	= "keyboard",
 		.pm	= pm_sleep_ptr(&spear_kbd_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 11/52] input: stmpe-keypad - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 10/52] input: spear-keyboard " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 12/52] input: 88pm80x_onkey " Uwe Kleine-König
                   ` (43 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Maxime Coquelin, Alexandre Torgue, linux-input, linux-stm32,
	linux-arm-kernel, kernel

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>
---
 drivers/input/keyboard/stmpe-keypad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c
index 2c6c53290cc0..2013c0afd0c3 100644
--- a/drivers/input/keyboard/stmpe-keypad.c
+++ b/drivers/input/keyboard/stmpe-keypad.c
@@ -404,20 +404,18 @@ static int stmpe_keypad_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int stmpe_keypad_remove(struct platform_device *pdev)
+static void stmpe_keypad_remove(struct platform_device *pdev)
 {
 	struct stmpe_keypad *keypad = platform_get_drvdata(pdev);
 
 	stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD);
-
-	return 0;
 }
 
 static struct platform_driver stmpe_keypad_driver = {
 	.driver.name	= "stmpe-keypad",
 	.driver.owner	= THIS_MODULE,
 	.probe		= stmpe_keypad_probe,
-	.remove		= stmpe_keypad_remove,
+	.remove_new	= stmpe_keypad_remove,
 };
 module_platform_driver(stmpe_keypad_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 12/52] input: 88pm80x_onkey - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 11/52] input: stmpe-keypad " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 13/52] input: da9052_onkey " Uwe Kleine-König
                   ` (42 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/88pm80x_onkey.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
index 51c8a326fd06..31f0702c3d01 100644
--- a/drivers/input/misc/88pm80x_onkey.c
+++ b/drivers/input/misc/88pm80x_onkey.c
@@ -138,14 +138,13 @@ static int pm80x_onkey_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int pm80x_onkey_remove(struct platform_device *pdev)
+static void pm80x_onkey_remove(struct platform_device *pdev)
 {
 	struct pm80x_onkey_info *info = platform_get_drvdata(pdev);
 
 	pm80x_free_irq(info->pm80x, info->irq, info);
 	input_unregister_device(info->idev);
 	kfree(info);
-	return 0;
 }
 
 static struct platform_driver pm80x_onkey_driver = {
@@ -154,7 +153,7 @@ static struct platform_driver pm80x_onkey_driver = {
 		   .pm = &pm80x_onkey_pm_ops,
 		   },
 	.probe = pm80x_onkey_probe,
-	.remove = pm80x_onkey_remove,
+	.remove_new = pm80x_onkey_remove,
 };
 
 module_platform_driver(pm80x_onkey_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 13/52] input: da9052_onkey - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 12/52] input: 88pm80x_onkey " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 14/52] input: da9055_onkey " Uwe Kleine-König
                   ` (41 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Support Opensource, linux-input, kernel

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>
---
 drivers/input/misc/da9052_onkey.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c
index 6d1152850a6d..7a1122e1efb9 100644
--- a/drivers/input/misc/da9052_onkey.c
+++ b/drivers/input/misc/da9052_onkey.c
@@ -127,7 +127,7 @@ static int da9052_onkey_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int da9052_onkey_remove(struct platform_device *pdev)
+static void da9052_onkey_remove(struct platform_device *pdev)
 {
 	struct da9052_onkey *onkey = platform_get_drvdata(pdev);
 
@@ -136,13 +136,11 @@ static int da9052_onkey_remove(struct platform_device *pdev)
 
 	input_unregister_device(onkey->input);
 	kfree(onkey);
-
-	return 0;
 }
 
 static struct platform_driver da9052_onkey_driver = {
 	.probe	= da9052_onkey_probe,
-	.remove	= da9052_onkey_remove,
+	.remove_new = da9052_onkey_remove,
 	.driver = {
 		.name	= "da9052-onkey",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 14/52] input: da9055_onkey - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 13/52] input: da9052_onkey " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 15/52] input: ideapad_slidebar " Uwe Kleine-König
                   ` (40 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Support Opensource, linux-input, kernel

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>
---
 drivers/input/misc/da9055_onkey.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/da9055_onkey.c b/drivers/input/misc/da9055_onkey.c
index 7a0d3a1d503c..871812f1b398 100644
--- a/drivers/input/misc/da9055_onkey.c
+++ b/drivers/input/misc/da9055_onkey.c
@@ -132,7 +132,7 @@ static int da9055_onkey_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int da9055_onkey_remove(struct platform_device *pdev)
+static void da9055_onkey_remove(struct platform_device *pdev)
 {
 	struct da9055_onkey *onkey = platform_get_drvdata(pdev);
 	int irq = platform_get_irq_byname(pdev, "ONKEY");
@@ -141,13 +141,11 @@ static int da9055_onkey_remove(struct platform_device *pdev)
 	free_irq(irq, onkey);
 	cancel_delayed_work_sync(&onkey->work);
 	input_unregister_device(onkey->input);
-
-	return 0;
 }
 
 static struct platform_driver da9055_onkey_driver = {
 	.probe	= da9055_onkey_probe,
-	.remove	= da9055_onkey_remove,
+	.remove_new = da9055_onkey_remove,
 	.driver = {
 		.name	= "da9055-onkey",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 15/52] input: ideapad_slidebar - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 14/52] input: da9055_onkey " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 16/52] input: m68kspkr " Uwe Kleine-König
                   ` (39 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Andrey Moiseev, linux-input, kernel

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>
---
 drivers/input/misc/ideapad_slidebar.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/ideapad_slidebar.c b/drivers/input/misc/ideapad_slidebar.c
index 68f1c584da05..fa4e7f67d713 100644
--- a/drivers/input/misc/ideapad_slidebar.c
+++ b/drivers/input/misc/ideapad_slidebar.c
@@ -256,20 +256,18 @@ static int __init ideapad_probe(struct platform_device* pdev)
 	return err;
 }
 
-static int ideapad_remove(struct platform_device *pdev)
+static void ideapad_remove(struct platform_device *pdev)
 {
 	i8042_remove_filter(slidebar_i8042_filter);
 	input_unregister_device(slidebar_input_dev);
 	release_region(IDEAPAD_BASE, 3);
-
-	return 0;
 }
 
 static struct platform_driver slidebar_drv = {
 	.driver = {
 		.name = "ideapad_slidebar",
 	},
-	.remove = ideapad_remove,
+	.remove_new = ideapad_remove,
 };
 
 static int __init ideapad_dmi_check(const struct dmi_system_id *id)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 16/52] input: m68kspkr - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 15/52] input: ideapad_slidebar " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 17/52] input: max8997_haptic " Uwe Kleine-König
                   ` (38 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/m68kspkr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c
index 25fcf1467151..3fe0a85c45e0 100644
--- a/drivers/input/misc/m68kspkr.c
+++ b/drivers/input/misc/m68kspkr.c
@@ -75,15 +75,13 @@ static int m68kspkr_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int m68kspkr_remove(struct platform_device *dev)
+static void m68kspkr_remove(struct platform_device *dev)
 {
 	struct input_dev *input_dev = platform_get_drvdata(dev);
 
 	input_unregister_device(input_dev);
 	/* turn off the speaker */
 	m68kspkr_event(NULL, EV_SND, SND_BELL, 0);
-
-	return 0;
 }
 
 static void m68kspkr_shutdown(struct platform_device *dev)
@@ -97,7 +95,7 @@ static struct platform_driver m68kspkr_platform_driver = {
 		.name	= "m68kspkr",
 	},
 	.probe		= m68kspkr_probe,
-	.remove		= m68kspkr_remove,
+	.remove_new	= m68kspkr_remove,
 	.shutdown	= m68kspkr_shutdown,
 };
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 17/52] input: max8997_haptic - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 16/52] input: m68kspkr " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 18/52] input: mc13783-pwrbutton " Uwe Kleine-König
                   ` (37 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Lee Jones, Linus Walleij, Jonathan Cameron, linux-input, kernel

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>
---
 drivers/input/misc/max8997_haptic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index c4dff476d479..8861a67be575 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -351,7 +351,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int max8997_haptic_remove(struct platform_device *pdev)
+static void max8997_haptic_remove(struct platform_device *pdev)
 {
 	struct max8997_haptic *chip = platform_get_drvdata(pdev);
 
@@ -362,8 +362,6 @@ static int max8997_haptic_remove(struct platform_device *pdev)
 		pwm_put(chip->pwm);
 
 	kfree(chip);
-
-	return 0;
 }
 
 static int max8997_haptic_suspend(struct device *dev)
@@ -391,7 +389,7 @@ static struct platform_driver max8997_haptic_driver = {
 		.pm	= pm_sleep_ptr(&max8997_haptic_pm_ops),
 	},
 	.probe		= max8997_haptic_probe,
-	.remove		= max8997_haptic_remove,
+	.remove_new	= max8997_haptic_remove,
 	.id_table	= max8997_haptic_id,
 };
 module_platform_driver(max8997_haptic_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 18/52] input: mc13783-pwrbutton - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 17/52] input: max8997_haptic " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 19/52] input: palmas-pwrbutton " Uwe Kleine-König
                   ` (36 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/mc13783-pwrbutton.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c
index 0636eee4bb6c..1c8c939638f6 100644
--- a/drivers/input/misc/mc13783-pwrbutton.c
+++ b/drivers/input/misc/mc13783-pwrbutton.c
@@ -229,7 +229,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int mc13783_pwrbutton_remove(struct platform_device *pdev)
+static void mc13783_pwrbutton_remove(struct platform_device *pdev)
 {
 	struct mc13783_pwrb *priv = platform_get_drvdata(pdev);
 	const struct mc13xxx_buttons_platform_data *pdata;
@@ -249,13 +249,11 @@ static int mc13783_pwrbutton_remove(struct platform_device *pdev)
 
 	input_unregister_device(priv->pwr);
 	kfree(priv);
-
-	return 0;
 }
 
 static struct platform_driver mc13783_pwrbutton_driver = {
 	.probe		= mc13783_pwrbutton_probe,
-	.remove		= mc13783_pwrbutton_remove,
+	.remove_new	= mc13783_pwrbutton_remove,
 	.driver		= {
 		.name	= "mc13783-pwrbutton",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 19/52] input: palmas-pwrbutton - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 18/52] input: mc13783-pwrbutton " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 20/52] input: pcap_keys " Uwe Kleine-König
                   ` (35 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij, linux-input, kernel

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>
---
 drivers/input/misc/palmas-pwrbutton.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index 7e361727b0d9..06d5972e8e84 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -245,7 +245,7 @@ static int palmas_pwron_probe(struct platform_device *pdev)
  *
  * Return: 0
  */
-static int palmas_pwron_remove(struct platform_device *pdev)
+static void palmas_pwron_remove(struct platform_device *pdev)
 {
 	struct palmas_pwron *pwron = platform_get_drvdata(pdev);
 
@@ -254,8 +254,6 @@ static int palmas_pwron_remove(struct platform_device *pdev)
 
 	input_unregister_device(pwron->input_dev);
 	kfree(pwron);
-
-	return 0;
 }
 
 /**
@@ -312,7 +310,7 @@ MODULE_DEVICE_TABLE(of, of_palmas_pwr_match);
 
 static struct platform_driver palmas_pwron_driver = {
 	.probe	= palmas_pwron_probe,
-	.remove	= palmas_pwron_remove,
+	.remove_new = palmas_pwron_remove,
 	.driver	= {
 		.name	= "palmas_pwrbutton",
 		.of_match_table = of_match_ptr(of_palmas_pwr_match),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 20/52] input: pcap_keys - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 19/52] input: palmas-pwrbutton " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 21/52] input: pcf50633-input " Uwe Kleine-König
                   ` (34 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/pcap_keys.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c
index b5a53636d7e2..8a7e9ada5952 100644
--- a/drivers/input/misc/pcap_keys.c
+++ b/drivers/input/misc/pcap_keys.c
@@ -99,7 +99,7 @@ static int pcap_keys_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int pcap_keys_remove(struct platform_device *pdev)
+static void pcap_keys_remove(struct platform_device *pdev)
 {
 	struct pcap_keys *pcap_keys = platform_get_drvdata(pdev);
 
@@ -108,13 +108,11 @@ static int pcap_keys_remove(struct platform_device *pdev)
 
 	input_unregister_device(pcap_keys->input);
 	kfree(pcap_keys);
-
-	return 0;
 }
 
 static struct platform_driver pcap_keys_device_driver = {
 	.probe		= pcap_keys_probe,
-	.remove		= pcap_keys_remove,
+	.remove_new	= pcap_keys_remove,
 	.driver		= {
 		.name	= "pcap-keys",
 	}
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 21/52] input: pcf50633-input - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 20/52] input: pcap_keys " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:57 ` [PATCH 22/52] input: pcspkr " Uwe Kleine-König
                   ` (33 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/pcf50633-input.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
index 4c60c70c4c10..c5c5fe236c18 100644
--- a/drivers/input/misc/pcf50633-input.c
+++ b/drivers/input/misc/pcf50633-input.c
@@ -87,7 +87,7 @@ static int pcf50633_input_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pcf50633_input_remove(struct platform_device *pdev)
+static void pcf50633_input_remove(struct platform_device *pdev)
 {
 	struct pcf50633_input *input  = platform_get_drvdata(pdev);
 
@@ -96,8 +96,6 @@ static int pcf50633_input_remove(struct platform_device *pdev)
 
 	input_unregister_device(input->input_dev);
 	kfree(input);
-
-	return 0;
 }
 
 static struct platform_driver pcf50633_input_driver = {
@@ -105,7 +103,7 @@ static struct platform_driver pcf50633_input_driver = {
 		.name = "pcf50633-input",
 	},
 	.probe = pcf50633_input_probe,
-	.remove = pcf50633_input_remove,
+	.remove_new = pcf50633_input_remove,
 };
 module_platform_driver(pcf50633_input_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 22/52] input: pcspkr - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 21/52] input: pcf50633-input " Uwe Kleine-König
@ 2023-09-20 12:57 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 23/52] input: pm8941-pwrkey " Uwe Kleine-König
                   ` (32 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:57 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/misc/pcspkr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 9c666b2f14fe..897854fd245f 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -95,15 +95,13 @@ static int pcspkr_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int pcspkr_remove(struct platform_device *dev)
+static void pcspkr_remove(struct platform_device *dev)
 {
 	struct input_dev *pcspkr_dev = platform_get_drvdata(dev);
 
 	input_unregister_device(pcspkr_dev);
 	/* turn off the speaker */
 	pcspkr_event(NULL, EV_SND, SND_BELL, 0);
-
-	return 0;
 }
 
 static int pcspkr_suspend(struct device *dev)
@@ -129,7 +127,7 @@ static struct platform_driver pcspkr_platform_driver = {
 		.pm	= &pcspkr_pm_ops,
 	},
 	.probe		= pcspkr_probe,
-	.remove		= pcspkr_remove,
+	.remove_new	= pcspkr_remove,
 	.shutdown	= pcspkr_shutdown,
 };
 module_platform_driver(pcspkr_platform_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 23/52] input: pm8941-pwrkey - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 preceding siblings ...)
  2023-09-20 12:57 ` [PATCH 22/52] input: pcspkr " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 13:03   ` Konrad Dybcio
  2023-09-20 12:58 ` [PATCH 24/52] input: soc_button_array " Uwe Kleine-König
                   ` (31 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-input, kernel

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>
---
 drivers/input/misc/pm8941-pwrkey.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
index ba747c5b2b5f..bab710023d8f 100644
--- a/drivers/input/misc/pm8941-pwrkey.c
+++ b/drivers/input/misc/pm8941-pwrkey.c
@@ -408,14 +408,12 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pm8941_pwrkey_remove(struct platform_device *pdev)
+static void pm8941_pwrkey_remove(struct platform_device *pdev)
 {
 	struct pm8941_pwrkey *pwrkey = platform_get_drvdata(pdev);
 
 	if (pwrkey->data->supports_ps_hold_poff_config)
 		unregister_reboot_notifier(&pwrkey->reboot_notifier);
-
-	return 0;
 }
 
 static const struct pm8941_data pwrkey_data = {
@@ -467,7 +465,7 @@ MODULE_DEVICE_TABLE(of, pm8941_pwr_key_id_table);
 
 static struct platform_driver pm8941_pwrkey_driver = {
 	.probe = pm8941_pwrkey_probe,
-	.remove = pm8941_pwrkey_remove,
+	.remove_new = pm8941_pwrkey_remove,
 	.driver = {
 		.name = "pm8941-pwrkey",
 		.pm = pm_sleep_ptr(&pm8941_pwr_key_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 24/52] input: soc_button_array - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 23/52] input: pm8941-pwrkey " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 25/52] input: sparcspkr " Uwe Kleine-König
                   ` (30 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Hans de Goede, linux-input, kernel

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>
---
 drivers/input/misc/soc_button_array.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index e79f5497948b..08bcee3d6bcc 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -411,7 +411,7 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev)
 	return button_info;
 }
 
-static int soc_button_remove(struct platform_device *pdev)
+static void soc_button_remove(struct platform_device *pdev)
 {
 	struct soc_button_data *priv = platform_get_drvdata(pdev);
 
@@ -420,8 +420,6 @@ static int soc_button_remove(struct platform_device *pdev)
 	for (i = 0; i < BUTTON_TYPES; i++)
 		if (priv->children[i])
 			platform_device_unregister(priv->children[i]);
-
-	return 0;
 }
 
 static int soc_button_probe(struct platform_device *pdev)
@@ -609,7 +607,7 @@ MODULE_DEVICE_TABLE(acpi, soc_button_acpi_match);
 
 static struct platform_driver soc_button_driver = {
 	.probe          = soc_button_probe,
-	.remove		= soc_button_remove,
+	.remove_new	= soc_button_remove,
 	.driver		= {
 		.name = KBUILD_MODNAME,
 		.acpi_match_table = ACPI_PTR(soc_button_acpi_match),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 25/52] input: sparcspkr - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 24/52] input: soc_button_array " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 26/52] input: wistron_btns " Uwe Kleine-König
                   ` (29 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rob Herring, linux-input, kernel

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>
---
 drivers/input/misc/sparcspkr.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index e5dd84725c6e..20020cbc0752 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -231,7 +231,7 @@ static int bbc_beep_probe(struct platform_device *op)
 	return err;
 }
 
-static int bbc_remove(struct platform_device *op)
+static void bbc_remove(struct platform_device *op)
 {
 	struct sparcspkr_state *state = platform_get_drvdata(op);
 	struct input_dev *input_dev = state->input_dev;
@@ -245,8 +245,6 @@ static int bbc_remove(struct platform_device *op)
 	of_iounmap(&op->resource[0], info->regs, 6);
 
 	kfree(state);
-
-	return 0;
 }
 
 static const struct of_device_id bbc_beep_match[] = {
@@ -264,7 +262,7 @@ static struct platform_driver bbc_beep_driver = {
 		.of_match_table = bbc_beep_match,
 	},
 	.probe		= bbc_beep_probe,
-	.remove		= bbc_remove,
+	.remove_new	= bbc_remove,
 	.shutdown	= sparcspkr_shutdown,
 };
 
@@ -310,7 +308,7 @@ static int grover_beep_probe(struct platform_device *op)
 	return err;
 }
 
-static int grover_remove(struct platform_device *op)
+static void grover_remove(struct platform_device *op)
 {
 	struct sparcspkr_state *state = platform_get_drvdata(op);
 	struct grover_beep_info *info = &state->u.grover;
@@ -325,8 +323,6 @@ static int grover_remove(struct platform_device *op)
 	of_iounmap(&op->resource[2], info->freq_regs, 2);
 
 	kfree(state);
-
-	return 0;
 }
 
 static const struct of_device_id grover_beep_match[] = {
@@ -344,7 +340,7 @@ static struct platform_driver grover_beep_driver = {
 		.of_match_table = grover_beep_match,
 	},
 	.probe		= grover_beep_probe,
-	.remove		= grover_remove,
+	.remove_new	= grover_remove,
 	.shutdown	= sparcspkr_shutdown,
 };
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 26/52] input: wistron_btns - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 25/52] input: sparcspkr " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 27/52] input: wm831x-on " Uwe Kleine-König
                   ` (28 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Miloslav Trmac, linux-input, kernel

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>
---
 drivers/input/misc/wistron_btns.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 111cb70cde46..5c4956678cd0 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -1286,13 +1286,11 @@ static int wistron_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int wistron_remove(struct platform_device *dev)
+static void wistron_remove(struct platform_device *dev)
 {
 	wistron_led_remove();
 	input_unregister_device(wistron_idev);
 	bios_detach();
-
-	return 0;
 }
 
 static int wistron_suspend(struct device *dev)
@@ -1336,7 +1334,7 @@ static struct platform_driver wistron_driver = {
 		.pm	= pm_sleep_ptr(&wistron_pm_ops),
 	},
 	.probe		= wistron_probe,
-	.remove		= wistron_remove,
+	.remove_new	= wistron_remove,
 };
 
 static int __init wb_module_init(void)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 27/52] input: wm831x-on - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 26/52] input: wistron_btns " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 14:24   ` Charles Keepax
  2023-09-20 12:58 ` [PATCH 28/52] input: navpoint " Uwe Kleine-König
                   ` (27 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: patches, linux-input, kernel

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>
---
 drivers/input/misc/wm831x-on.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c
index a42fe041b73c..e4a06c73b72d 100644
--- a/drivers/input/misc/wm831x-on.c
+++ b/drivers/input/misc/wm831x-on.c
@@ -123,20 +123,18 @@ static int wm831x_on_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int wm831x_on_remove(struct platform_device *pdev)
+static void wm831x_on_remove(struct platform_device *pdev)
 {
 	struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
 	int irq = platform_get_irq(pdev, 0);
 
 	free_irq(irq, wm831x_on);
 	cancel_delayed_work_sync(&wm831x_on->work);
-
-	return 0;
 }
 
 static struct platform_driver wm831x_on_driver = {
 	.probe		= wm831x_on_probe,
-	.remove		= wm831x_on_remove,
+	.remove_new	= wm831x_on_remove,
 	.driver		= {
 		.name	= "wm831x-on",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 28/52] input: navpoint - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 27/52] input: wm831x-on " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 29/52] input: altera_ps2 " Uwe Kleine-König
                   ` (26 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jonathan Cameron, Linus Walleij, linux-input, kernel

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>
---
 drivers/input/mouse/navpoint.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c
index 2b7b86eef280..c00dc1275da2 100644
--- a/drivers/input/mouse/navpoint.c
+++ b/drivers/input/mouse/navpoint.c
@@ -295,7 +295,7 @@ static int navpoint_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int navpoint_remove(struct platform_device *pdev)
+static void navpoint_remove(struct platform_device *pdev)
 {
 	const struct navpoint_platform_data *pdata =
 					dev_get_platdata(&pdev->dev);
@@ -311,8 +311,6 @@ static int navpoint_remove(struct platform_device *pdev)
 
 	if (gpio_is_valid(pdata->gpio))
 		gpio_free(pdata->gpio);
-
-	return 0;
 }
 
 static int navpoint_suspend(struct device *dev)
@@ -348,7 +346,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(navpoint_pm_ops,
 
 static struct platform_driver navpoint_driver = {
 	.probe		= navpoint_probe,
-	.remove		= navpoint_remove,
+	.remove_new	= navpoint_remove,
 	.driver = {
 		.name	= "navpoint",
 		.pm	= pm_sleep_ptr(&navpoint_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 29/52] input: altera_ps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 28/52] input: navpoint " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 30/52] input: ams_delta_serio " Uwe Kleine-König
                   ` (25 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ye xingchen, linux-input, kernel

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>
---
 drivers/input/serio/altera_ps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c
index 9f8d7b332d1b..c5b634940cfc 100644
--- a/drivers/input/serio/altera_ps2.c
+++ b/drivers/input/serio/altera_ps2.c
@@ -125,13 +125,11 @@ static int altera_ps2_probe(struct platform_device *pdev)
 /*
  * Remove one device from this driver.
  */
-static int altera_ps2_remove(struct platform_device *pdev)
+static void altera_ps2_remove(struct platform_device *pdev)
 {
 	struct ps2if *ps2if = platform_get_drvdata(pdev);
 
 	serio_unregister_port(ps2if->io);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -148,7 +146,7 @@ MODULE_DEVICE_TABLE(of, altera_ps2_match);
  */
 static struct platform_driver altera_ps2_driver = {
 	.probe		= altera_ps2_probe,
-	.remove		= altera_ps2_remove,
+	.remove_new	= altera_ps2_remove,
 	.driver	= {
 		.name	= DRV_NAME,
 		.of_match_table = of_match_ptr(altera_ps2_match),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 30/52] input: ams_delta_serio - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 29/52] input: altera_ps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 31/52] input: apbps2 " Uwe Kleine-König
                   ` (24 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/serio/ams_delta_serio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index ec93cb4573c3..0bd6ae106809 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -173,18 +173,16 @@ static int ams_delta_serio_init(struct platform_device *pdev)
 	return 0;
 }
 
-static int ams_delta_serio_exit(struct platform_device *pdev)
+static void ams_delta_serio_exit(struct platform_device *pdev)
 {
 	struct ams_delta_serio *priv = platform_get_drvdata(pdev);
 
 	serio_unregister_port(priv->serio);
-
-	return 0;
 }
 
 static struct platform_driver ams_delta_serio_driver = {
 	.probe	= ams_delta_serio_init,
-	.remove	= ams_delta_serio_exit,
+	.remove_new = ams_delta_serio_exit,
 	.driver	= {
 		.name	= DRIVER_NAME
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 31/52] input: apbps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 30/52] input: ams_delta_serio " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 32/52] input: arc_ps2 " Uwe Kleine-König
                   ` (23 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rob Herring, ye xingchen, linux-input, kernel

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>
---
 drivers/input/serio/apbps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c
index 3f6866d39b86..dbbb10251520 100644
--- a/drivers/input/serio/apbps2.c
+++ b/drivers/input/serio/apbps2.c
@@ -187,13 +187,11 @@ static int apbps2_of_probe(struct platform_device *ofdev)
 	return 0;
 }
 
-static int apbps2_of_remove(struct platform_device *of_dev)
+static void apbps2_of_remove(struct platform_device *of_dev)
 {
 	struct apbps2_priv *priv = platform_get_drvdata(of_dev);
 
 	serio_unregister_port(priv->io);
-
-	return 0;
 }
 
 static const struct of_device_id apbps2_of_match[] = {
@@ -210,7 +208,7 @@ static struct platform_driver apbps2_of_driver = {
 		.of_match_table = apbps2_of_match,
 	},
 	.probe = apbps2_of_probe,
-	.remove = apbps2_of_remove,
+	.remove_new = apbps2_of_remove,
 };
 
 module_platform_driver(apbps2_of_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 32/52] input: arc_ps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 31/52] input: apbps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 33/52] input: ct82c710 " Uwe Kleine-König
                   ` (22 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ye xingchen, linux-input, kernel

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>
---
 drivers/input/serio/arc_ps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c
index a6debb13d527..9d8726830140 100644
--- a/drivers/input/serio/arc_ps2.c
+++ b/drivers/input/serio/arc_ps2.c
@@ -232,7 +232,7 @@ static int arc_ps2_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int arc_ps2_remove(struct platform_device *pdev)
+static void arc_ps2_remove(struct platform_device *pdev)
 {
 	struct arc_ps2_data *arc_ps2 = platform_get_drvdata(pdev);
 	int i;
@@ -244,8 +244,6 @@ static int arc_ps2_remove(struct platform_device *pdev)
 	dev_dbg(&pdev->dev, "frame error count = %i\n", arc_ps2->frame_error);
 	dev_dbg(&pdev->dev, "buffer overflow count = %i\n",
 		arc_ps2->buf_overflow);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -262,7 +260,7 @@ static struct platform_driver arc_ps2_driver = {
 		.of_match_table	= of_match_ptr(arc_ps2_match),
 	},
 	.probe	= arc_ps2_probe,
-	.remove	= arc_ps2_remove,
+	.remove_new = arc_ps2_remove,
 };
 
 module_platform_driver(arc_ps2_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 33/52] input: ct82c710 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 32/52] input: arc_ps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Christophe JAILLET, linux-input, kernel

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>
---
 drivers/input/serio/ct82c710.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index 3da751f4a6bf..d5c9bb3d0103 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -180,11 +180,9 @@ static int ct82c710_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int ct82c710_remove(struct platform_device *dev)
+static void ct82c710_remove(struct platform_device *dev)
 {
 	serio_unregister_port(ct82c710_port);
-
-	return 0;
 }
 
 static struct platform_driver ct82c710_driver = {
@@ -192,7 +190,7 @@ static struct platform_driver ct82c710_driver = {
 		.name	= "ct82c710",
 	},
 	.probe		= ct82c710_probe,
-	.remove		= ct82c710_remove,
+	.remove_new	= ct82c710_remove,
 };
 
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (32 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 33/52] input: ct82c710 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 13:06   ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 35/52] input: i8042 - " Uwe Kleine-König
                   ` (20 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rob Herring, Liang He, linux-input, kernel

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>
---
 drivers/input/serio/i8042-sparcio.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index b68793bf05c8..c2fda54dc384 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -82,11 +82,9 @@ static int sparc_i8042_probe(struct platform_device *op)
 	return 0;
 }
 
-static int sparc_i8042_remove(struct platform_device *op)
+static void sparc_i8042_remove(struct platform_device *op)
 {
 	of_iounmap(kbd_res, kbd_iobase, 8);
-
-	return 0;
 }
 
 static const struct of_device_id sparc_i8042_match[] = {
@@ -103,7 +101,7 @@ static struct platform_driver sparc_i8042_driver = {
 		.of_match_table = sparc_i8042_match,
 	},
 	.probe		= sparc_i8042_probe,
-	.remove		= sparc_i8042_remove,
+	.remove_new	= sparc_i8042_remove,
 };
 
 static bool i8042_is_mr_coffee(void)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 35/52] input: i8042 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (33 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 36/52] input: ioc3kbd " Uwe Kleine-König
                   ` (19 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Chen Jun, linux-input, kernel

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>
---
 drivers/input/serio/i8042.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 6dac7c1853a5..9fbb8d31575a 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1584,13 +1584,11 @@ static int i8042_probe(struct platform_device *dev)
 	return error;
 }
 
-static int i8042_remove(struct platform_device *dev)
+static void i8042_remove(struct platform_device *dev)
 {
 	i8042_unregister_ports();
 	i8042_free_irqs();
 	i8042_controller_reset(false);
-
-	return 0;
 }
 
 static struct platform_driver i8042_driver = {
@@ -1601,7 +1599,7 @@ static struct platform_driver i8042_driver = {
 #endif
 	},
 	.probe		= i8042_probe,
-	.remove		= i8042_remove,
+	.remove_new	= i8042_remove,
 	.shutdown	= i8042_shutdown,
 };
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 36/52] input: ioc3kbd - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (34 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 35/52] input: i8042 - " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 37/52] input: maceps2 " Uwe Kleine-König
                   ` (18 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/serio/ioc3kbd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/ioc3kbd.c b/drivers/input/serio/ioc3kbd.c
index d51bfe912db5..50552dc7b4f5 100644
--- a/drivers/input/serio/ioc3kbd.c
+++ b/drivers/input/serio/ioc3kbd.c
@@ -190,7 +190,7 @@ static int ioc3kbd_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int ioc3kbd_remove(struct platform_device *pdev)
+static void ioc3kbd_remove(struct platform_device *pdev)
 {
 	struct ioc3kbd_data *d = platform_get_drvdata(pdev);
 
@@ -198,13 +198,11 @@ static int ioc3kbd_remove(struct platform_device *pdev)
 
 	serio_unregister_port(d->kbd);
 	serio_unregister_port(d->aux);
-
-	return 0;
 }
 
 static struct platform_driver ioc3kbd_driver = {
 	.probe          = ioc3kbd_probe,
-	.remove         = ioc3kbd_remove,
+	.remove_new     = ioc3kbd_remove,
 	.driver = {
 		.name = "ioc3-kbd",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 37/52] input: maceps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (35 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 36/52] input: ioc3kbd " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 38/52] input: olpc_apsp " Uwe Kleine-König
                   ` (17 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/serio/maceps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c
index 629e15089c21..5ccfb82759b3 100644
--- a/drivers/input/serio/maceps2.c
+++ b/drivers/input/serio/maceps2.c
@@ -148,12 +148,10 @@ static int maceps2_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int maceps2_remove(struct platform_device *dev)
+static void maceps2_remove(struct platform_device *dev)
 {
 	serio_unregister_port(maceps2_port[0]);
 	serio_unregister_port(maceps2_port[1]);
-
-	return 0;
 }
 
 static struct platform_driver maceps2_driver = {
@@ -161,7 +159,7 @@ static struct platform_driver maceps2_driver = {
 		.name	= "maceps2",
 	},
 	.probe		= maceps2_probe,
-	.remove		= maceps2_remove,
+	.remove_new	= maceps2_remove,
 };
 
 static int __init maceps2_init(void)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 38/52] input: olpc_apsp - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (36 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 37/52] input: maceps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 39/52] input: ps2-gpio " Uwe Kleine-König
                   ` (16 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ye xingchen, linux-input, kernel

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>
---
 drivers/input/serio/olpc_apsp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index 33a8e5889bd8..240a714f7081 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -238,7 +238,7 @@ static int olpc_apsp_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int olpc_apsp_remove(struct platform_device *pdev)
+static void olpc_apsp_remove(struct platform_device *pdev)
 {
 	struct olpc_apsp *priv = platform_get_drvdata(pdev);
 
@@ -246,8 +246,6 @@ static int olpc_apsp_remove(struct platform_device *pdev)
 
 	serio_unregister_port(priv->kbio);
 	serio_unregister_port(priv->padio);
-
-	return 0;
 }
 
 static const struct of_device_id olpc_apsp_dt_ids[] = {
@@ -258,7 +256,7 @@ MODULE_DEVICE_TABLE(of, olpc_apsp_dt_ids);
 
 static struct platform_driver olpc_apsp_driver = {
 	.probe		= olpc_apsp_probe,
-	.remove		= olpc_apsp_remove,
+	.remove_new	= olpc_apsp_remove,
 	.driver		= {
 		.name	= "olpc-apsp",
 		.of_match_table = olpc_apsp_dt_ids,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 39/52] input: ps2-gpio - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (37 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 38/52] input: olpc_apsp " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 40/52] input: q40kbd " Uwe Kleine-König
                   ` (15 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/serio/ps2-gpio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index bc1dc484389b..c3ff60859a03 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -476,12 +476,11 @@ static int ps2_gpio_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int ps2_gpio_remove(struct platform_device *pdev)
+static void ps2_gpio_remove(struct platform_device *pdev)
 {
 	struct ps2_gpio_data *drvdata = platform_get_drvdata(pdev);
 
 	serio_unregister_port(drvdata->serio);
-	return 0;
 }
 
 #if defined(CONFIG_OF)
@@ -494,7 +493,7 @@ MODULE_DEVICE_TABLE(of, ps2_gpio_match);
 
 static struct platform_driver ps2_gpio_driver = {
 	.probe		= ps2_gpio_probe,
-	.remove		= ps2_gpio_remove,
+	.remove_new	= ps2_gpio_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = of_match_ptr(ps2_gpio_match),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 40/52] input: q40kbd - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (38 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 39/52] input: ps2-gpio " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 41/52] input: rpckbd " Uwe Kleine-König
                   ` (14 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Christophe JAILLET, linux-input, kernel

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>
---
 drivers/input/serio/q40kbd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
index ba04058fc3cb..3f81f8749cd5 100644
--- a/drivers/input/serio/q40kbd.c
+++ b/drivers/input/serio/q40kbd.c
@@ -148,7 +148,7 @@ static int q40kbd_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int q40kbd_remove(struct platform_device *pdev)
+static void q40kbd_remove(struct platform_device *pdev)
 {
 	struct q40kbd *q40kbd = platform_get_drvdata(pdev);
 
@@ -160,15 +160,13 @@ static int q40kbd_remove(struct platform_device *pdev)
 	serio_unregister_port(q40kbd->port);
 	free_irq(Q40_IRQ_KEYBOARD, q40kbd);
 	kfree(q40kbd);
-
-	return 0;
 }
 
 static struct platform_driver q40kbd_driver = {
 	.driver		= {
 		.name	= "q40kbd",
 	},
-	.remove		= q40kbd_remove,
+	.remove_new	= q40kbd_remove,
 };
 
 module_platform_driver_probe(q40kbd_driver, q40kbd_probe);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 41/52] input: rpckbd - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (39 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 40/52] input: q40kbd " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 42/52] input: sun4i-ps2 " Uwe Kleine-König
                   ` (13 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Ruan Jinjie, Christophe JAILLET, linux-input, kernel

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>
---
 drivers/input/serio/rpckbd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index e8a9709f32eb..9bbfefd092c0 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -133,20 +133,18 @@ static int rpckbd_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int rpckbd_remove(struct platform_device *dev)
+static void rpckbd_remove(struct platform_device *dev)
 {
 	struct serio *serio = platform_get_drvdata(dev);
 	struct rpckbd_data *rpckbd = serio->port_data;
 
 	serio_unregister_port(serio);
 	kfree(rpckbd);
-
-	return 0;
 }
 
 static struct platform_driver rpckbd_driver = {
 	.probe		= rpckbd_probe,
-	.remove		= rpckbd_remove,
+	.remove_new	= rpckbd_remove,
 	.driver		= {
 		.name	= "kart",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 42/52] input: sun4i-ps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (40 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 41/52] input: rpckbd " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 16:07   ` Jernej Škrabec
  2023-09-20 12:58 ` [PATCH 43/52] input: xilinx_ps2 " Uwe Kleine-König
                   ` (12 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-input,
	linux-arm-kernel, linux-sunxi, kernel

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>
---
 drivers/input/serio/sun4i-ps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c
index eb262640192e..aec66d9f5176 100644
--- a/drivers/input/serio/sun4i-ps2.c
+++ b/drivers/input/serio/sun4i-ps2.c
@@ -297,7 +297,7 @@ static int sun4i_ps2_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int sun4i_ps2_remove(struct platform_device *pdev)
+static void sun4i_ps2_remove(struct platform_device *pdev)
 {
 	struct sun4i_ps2data *drvdata = platform_get_drvdata(pdev);
 
@@ -311,8 +311,6 @@ static int sun4i_ps2_remove(struct platform_device *pdev)
 	iounmap(drvdata->reg_base);
 
 	kfree(drvdata);
-
-	return 0;
 }
 
 static const struct of_device_id sun4i_ps2_match[] = {
@@ -324,7 +322,7 @@ MODULE_DEVICE_TABLE(of, sun4i_ps2_match);
 
 static struct platform_driver sun4i_ps2_driver = {
 	.probe		= sun4i_ps2_probe,
-	.remove		= sun4i_ps2_remove,
+	.remove_new	= sun4i_ps2_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = sun4i_ps2_match,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 43/52] input: xilinx_ps2 - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (41 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 42/52] input: sun4i-ps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 44/52] input: da9052_tsi " Uwe Kleine-König
                   ` (11 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Michal Simek, Rob Herring, linux-input, linux-arm-kernel, kernel

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>
---
 drivers/input/serio/xilinx_ps2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index f3d28da70b75..d8f9faf2b529 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -329,7 +329,7 @@ static int xps2_of_probe(struct platform_device *ofdev)
  * if the driver module is being unloaded. It frees any resources allocated to
  * the device.
  */
-static int xps2_of_remove(struct platform_device *of_dev)
+static void xps2_of_remove(struct platform_device *of_dev)
 {
 	struct xps2data *drvdata = platform_get_drvdata(of_dev);
 	struct resource r_mem; /* IO mem resources */
@@ -344,8 +344,6 @@ static int xps2_of_remove(struct platform_device *of_dev)
 		release_mem_region(r_mem.start, resource_size(&r_mem));
 
 	kfree(drvdata);
-
-	return 0;
 }
 
 /* Match table for of_platform binding */
@@ -361,7 +359,7 @@ static struct platform_driver xps2_of_driver = {
 		.of_match_table = xps2_of_match,
 	},
 	.probe		= xps2_of_probe,
-	.remove		= xps2_of_remove,
+	.remove_new	= xps2_of_remove,
 };
 module_platform_driver(xps2_of_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 44/52] input: da9052_tsi - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (42 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 43/52] input: xilinx_ps2 " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 45/52] input: mainstone-wm97xx " Uwe Kleine-König
                   ` (10 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Support Opensource, linux-input, kernel

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>
---
 drivers/input/touchscreen/da9052_tsi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c
index f91d0e02ddae..d71690ce6463 100644
--- a/drivers/input/touchscreen/da9052_tsi.c
+++ b/drivers/input/touchscreen/da9052_tsi.c
@@ -311,7 +311,7 @@ static int da9052_ts_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int  da9052_ts_remove(struct platform_device *pdev)
+static void da9052_ts_remove(struct platform_device *pdev)
 {
 	struct da9052_tsi *tsi = platform_get_drvdata(pdev);
 
@@ -322,13 +322,11 @@ static int  da9052_ts_remove(struct platform_device *pdev)
 
 	input_unregister_device(tsi->dev);
 	kfree(tsi);
-
-	return 0;
 }
 
 static struct platform_driver da9052_tsi_driver = {
 	.probe	= da9052_ts_probe,
-	.remove	= da9052_ts_remove,
+	.remove_new = da9052_ts_remove,
 	.driver	= {
 		.name	= "da9052-tsi",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 45/52] input: mainstone-wm97xx - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (43 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 44/52] input: da9052_tsi " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 46/52] input: mc13783_ts " Uwe Kleine-König
                   ` (9 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Robert Jarzmik, Dmitry Baryshkov, Arnd Bergmann, linux-input,
	kernel

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>
---
 drivers/input/touchscreen/mainstone-wm97xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index 85b95ed461e7..bfbebe245040 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -252,18 +252,16 @@ static int mainstone_wm97xx_probe(struct platform_device *pdev)
 	return wm97xx_register_mach_ops(wm, &mainstone_mach_ops);
 }
 
-static int mainstone_wm97xx_remove(struct platform_device *pdev)
+static void mainstone_wm97xx_remove(struct platform_device *pdev)
 {
 	struct wm97xx *wm = platform_get_drvdata(pdev);
 
 	wm97xx_unregister_mach_ops(wm);
-
-	return 0;
 }
 
 static struct platform_driver mainstone_wm97xx_driver = {
 	.probe	= mainstone_wm97xx_probe,
-	.remove	= mainstone_wm97xx_remove,
+	.remove_new = mainstone_wm97xx_remove,
 	.driver	= {
 		.name	= "wm97xx-touch",
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 46/52] input: mc13783_ts - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (44 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 45/52] input: mainstone-wm97xx " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 47/52] input: pcap_ts " Uwe Kleine-König
                   ` (8 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/touchscreen/mc13783_ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index ae0d978c83bf..cbcd6e34efb7 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -217,18 +217,16 @@ static int __init mc13783_ts_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mc13783_ts_remove(struct platform_device *pdev)
+static void mc13783_ts_remove(struct platform_device *pdev)
 {
 	struct mc13783_ts_priv *priv = platform_get_drvdata(pdev);
 
 	input_unregister_device(priv->idev);
 	kfree(priv);
-
-	return 0;
 }
 
 static struct platform_driver mc13783_ts_driver = {
-	.remove		= mc13783_ts_remove,
+	.remove_new	= mc13783_ts_remove,
 	.driver		= {
 		.name	= MC13783_TS_NAME,
 	},
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 47/52] input: pcap_ts - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (45 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 46/52] input: mc13783_ts " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 48/52] input: stmpe-ts " Uwe Kleine-König
                   ` (7 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

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>
---
 drivers/input/touchscreen/pcap_ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c
index b2da0194e02a..821245019fea 100644
--- a/drivers/input/touchscreen/pcap_ts.c
+++ b/drivers/input/touchscreen/pcap_ts.c
@@ -197,7 +197,7 @@ static int pcap_ts_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int pcap_ts_remove(struct platform_device *pdev)
+static void pcap_ts_remove(struct platform_device *pdev)
 {
 	struct pcap_ts *pcap_ts = platform_get_drvdata(pdev);
 
@@ -207,8 +207,6 @@ static int pcap_ts_remove(struct platform_device *pdev)
 	input_unregister_device(pcap_ts->input);
 
 	kfree(pcap_ts);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -240,7 +238,7 @@ static const struct dev_pm_ops pcap_ts_pm_ops = {
 
 static struct platform_driver pcap_ts_driver = {
 	.probe		= pcap_ts_probe,
-	.remove		= pcap_ts_remove,
+	.remove_new	= pcap_ts_remove,
 	.driver		= {
 		.name	= "pcap-ts",
 		.pm	= PCAP_TS_PM_OPS,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 48/52] input: stmpe-ts - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (46 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 47/52] input: pcap_ts " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 49/52] input: sun4i-ts " Uwe Kleine-König
                   ` (6 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Maxime Coquelin, Alexandre Torgue, linux-input, linux-stm32,
	linux-arm-kernel, kernel

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>
---
 drivers/input/touchscreen/stmpe-ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 25c45c3a3561..b204fdb2d22c 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -350,13 +350,11 @@ static int stmpe_input_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int stmpe_ts_remove(struct platform_device *pdev)
+static void stmpe_ts_remove(struct platform_device *pdev)
 {
 	struct stmpe_touch *ts = platform_get_drvdata(pdev);
 
 	stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN);
-
-	return 0;
 }
 
 static struct platform_driver stmpe_ts_driver = {
@@ -364,7 +362,7 @@ static struct platform_driver stmpe_ts_driver = {
 		.name = STMPE_TS_NAME,
 	},
 	.probe = stmpe_input_probe,
-	.remove = stmpe_ts_remove,
+	.remove_new = stmpe_ts_remove,
 };
 module_platform_driver(stmpe_ts_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 49/52] input: sun4i-ts - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (47 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 48/52] input: stmpe-ts " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 16:07   ` Jernej Škrabec
  2023-09-20 12:58 ` [PATCH 50/52] input: ti_am335x_tsc " Uwe Kleine-König
                   ` (5 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rafael J. Wysocki,
	Krzysztof Kozlowski, Daniel Lezcano, Jonathan Corbet, linux-input,
	linux-arm-kernel, linux-sunxi, kernel

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>
---
 drivers/input/touchscreen/sun4i-ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index bb3c6072fc82..92b2b840b4b7 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -375,7 +375,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int sun4i_ts_remove(struct platform_device *pdev)
+static void sun4i_ts_remove(struct platform_device *pdev)
 {
 	struct sun4i_ts_data *ts = platform_get_drvdata(pdev);
 
@@ -385,8 +385,6 @@ static int sun4i_ts_remove(struct platform_device *pdev)
 
 	/* Deactivate all IRQs */
 	writel(0, ts->base + TP_INT_FIFOC);
-
-	return 0;
 }
 
 static const struct of_device_id sun4i_ts_of_match[] = {
@@ -403,7 +401,7 @@ static struct platform_driver sun4i_ts_driver = {
 		.of_match_table = sun4i_ts_of_match,
 	},
 	.probe	= sun4i_ts_probe,
-	.remove	= sun4i_ts_remove,
+	.remove_new = sun4i_ts_remove,
 };
 
 module_platform_driver(sun4i_ts_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 50/52] input: ti_am335x_tsc - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (48 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 49/52] input: sun4i-ts " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 12:58 ` [PATCH 51/52] input: wm831x-ts " Uwe Kleine-König
                   ` (4 subsequent siblings)
  54 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Linus Walleij, Rob Herring, Jonathan Cameron, linux-input, kernel

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>
---
 drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 9aa4e35fb4f5..34324f8512ac 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -491,7 +491,7 @@ static int titsc_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int titsc_remove(struct platform_device *pdev)
+static void titsc_remove(struct platform_device *pdev)
 {
 	struct titsc *ts_dev = platform_get_drvdata(pdev);
 	u32 steps;
@@ -508,7 +508,6 @@ static int titsc_remove(struct platform_device *pdev)
 	input_unregister_device(ts_dev->input);
 
 	kfree(ts_dev);
-	return 0;
 }
 
 static int titsc_suspend(struct device *dev)
@@ -552,7 +551,7 @@ MODULE_DEVICE_TABLE(of, ti_tsc_dt_ids);
 
 static struct platform_driver ti_tsc_driver = {
 	.probe	= titsc_probe,
-	.remove	= titsc_remove,
+	.remove_new = titsc_remove,
 	.driver	= {
 		.name   = "TI-am335x-tsc",
 		.pm	= pm_sleep_ptr(&titsc_pm_ops),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 51/52] input: wm831x-ts - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (49 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 50/52] input: ti_am335x_tsc " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 14:24   ` Charles Keepax
  2023-09-20 12:58 ` [PATCH 52/52] input: wm97xx-core " Uwe Kleine-König
                   ` (3 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: patches, linux-input, kernel

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>
---
 drivers/input/touchscreen/wm831x-ts.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index 319f57fb9af5..9cee26b63341 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -374,14 +374,12 @@ static int wm831x_ts_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int wm831x_ts_remove(struct platform_device *pdev)
+static void wm831x_ts_remove(struct platform_device *pdev)
 {
 	struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
 
 	free_irq(wm831x_ts->pd_irq, wm831x_ts);
 	free_irq(wm831x_ts->data_irq, wm831x_ts);
-
-	return 0;
 }
 
 static struct platform_driver wm831x_ts_driver = {
@@ -389,7 +387,7 @@ static struct platform_driver wm831x_ts_driver = {
 		.name = "wm831x-touch",
 	},
 	.probe = wm831x_ts_probe,
-	.remove = wm831x_ts_remove,
+	.remove_new = wm831x_ts_remove,
 };
 module_platform_driver(wm831x_ts_driver);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* [PATCH 52/52] input: wm97xx-core - Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (50 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 51/52] input: wm831x-ts " Uwe Kleine-König
@ 2023-09-20 12:58 ` Uwe Kleine-König
  2023-09-20 14:24   ` Charles Keepax
  2023-09-24  2:48 ` [PATCH 00/52] input: " Dmitry Torokhov
                   ` (2 subsequent siblings)
  54 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 12:58 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Linus Walleij, Jonathan Cameron, patches, linux-input, kernel

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>
---
 drivers/input/touchscreen/wm97xx-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index ac3b3dd59488..f01f6cc9b59f 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -756,11 +756,9 @@ static int wm97xx_mfd_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int wm97xx_mfd_remove(struct platform_device *pdev)
+static void wm97xx_mfd_remove(struct platform_device *pdev)
 {
 	wm97xx_remove(&pdev->dev);
-
-	return 0;
 }
 
 static int wm97xx_suspend(struct device *dev)
@@ -878,7 +876,7 @@ static struct platform_driver wm97xx_mfd_driver = {
 		.pm =		pm_sleep_ptr(&wm97xx_pm_ops),
 	},
 	.probe =	wm97xx_mfd_probe,
-	.remove =	wm97xx_mfd_remove,
+	.remove_new =	wm97xx_mfd_remove,
 };
 
 static int __init wm97xx_init(void)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 67+ messages in thread

* Re: [PATCH 23/52] input: pm8941-pwrkey - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 23/52] input: pm8941-pwrkey " Uwe Kleine-König
@ 2023-09-20 13:03   ` Konrad Dybcio
  0 siblings, 0 replies; 67+ messages in thread
From: Konrad Dybcio @ 2023-09-20 13:03 UTC (permalink / raw)
  To: Uwe Kleine-König, Dmitry Torokhov
  Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, linux-input, kernel



On 9/20/23 14:58, 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>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: " Uwe Kleine-König
@ 2023-09-20 13:06   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-20 13:06 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rob Herring, Liang He, kernel, linux-input

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

Hello Dmitry,

for this patch's Subject my git filter-branch cmdline failed. I guess it
should be something like

	input: i8042-sparcio - Convert to platform remove callback returning void

instead. I'll wait until the dust settles. In the meantime feel free to
skip this patch or adapt the Subject yourself. In the former case I'll
come back to this patch later.

Thanks and sorry for the annoyance,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 27/52] input: wm831x-on - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 27/52] input: wm831x-on " Uwe Kleine-König
@ 2023-09-20 14:24   ` Charles Keepax
  0 siblings, 0 replies; 67+ messages in thread
From: Charles Keepax @ 2023-09-20 14:24 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Dmitry Torokhov, patches, linux-input, kernel

On Wed, Sep 20, 2023 at 02:58:04PM +0200, 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: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 51/52] input: wm831x-ts - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 51/52] input: wm831x-ts " Uwe Kleine-König
@ 2023-09-20 14:24   ` Charles Keepax
  0 siblings, 0 replies; 67+ messages in thread
From: Charles Keepax @ 2023-09-20 14:24 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Dmitry Torokhov, patches, linux-input, kernel

On Wed, Sep 20, 2023 at 02:58:28PM +0200, 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: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 52/52] input: wm97xx-core - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 52/52] input: wm97xx-core " Uwe Kleine-König
@ 2023-09-20 14:24   ` Charles Keepax
  0 siblings, 0 replies; 67+ messages in thread
From: Charles Keepax @ 2023-09-20 14:24 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Dmitry Torokhov, Linus Walleij, Jonathan Cameron, patches,
	linux-input, kernel

On Wed, Sep 20, 2023 at 02:58:29PM +0200, 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: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 49/52] input: sun4i-ts - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 49/52] input: sun4i-ts " Uwe Kleine-König
@ 2023-09-20 16:07   ` Jernej Škrabec
  0 siblings, 0 replies; 67+ messages in thread
From: Jernej Škrabec @ 2023-09-20 16:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Uwe Kleine-König
  Cc: Chen-Yu Tsai, Samuel Holland, Rafael J. Wysocki,
	Krzysztof Kozlowski, Daniel Lezcano, Jonathan Corbet, linux-input,
	linux-arm-kernel, linux-sunxi, kernel

Dne sreda, 20. september 2023 ob 14:58:26 CEST je Uwe Kleine-König napisal(a):
> 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: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/input/touchscreen/sun4i-ts.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sun4i-ts.c
> b/drivers/input/touchscreen/sun4i-ts.c index bb3c6072fc82..92b2b840b4b7
> 100644
> --- a/drivers/input/touchscreen/sun4i-ts.c
> +++ b/drivers/input/touchscreen/sun4i-ts.c
> @@ -375,7 +375,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  	return 0;
>  }
> 
> -static int sun4i_ts_remove(struct platform_device *pdev)
> +static void sun4i_ts_remove(struct platform_device *pdev)
>  {
>  	struct sun4i_ts_data *ts = platform_get_drvdata(pdev);
> 
> @@ -385,8 +385,6 @@ static int sun4i_ts_remove(struct platform_device *pdev)
> 
>  	/* Deactivate all IRQs */
>  	writel(0, ts->base + TP_INT_FIFOC);
> -
> -	return 0;
>  }
> 
>  static const struct of_device_id sun4i_ts_of_match[] = {
> @@ -403,7 +401,7 @@ static struct platform_driver sun4i_ts_driver = {
>  		.of_match_table = sun4i_ts_of_match,
>  	},
>  	.probe	= sun4i_ts_probe,
> -	.remove	= sun4i_ts_remove,
> +	.remove_new = sun4i_ts_remove,
>  };
> 
>  module_platform_driver(sun4i_ts_driver);





^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 42/52] input: sun4i-ps2 - Convert to platform remove callback returning void
  2023-09-20 12:58 ` [PATCH 42/52] input: sun4i-ps2 " Uwe Kleine-König
@ 2023-09-20 16:07   ` Jernej Škrabec
  0 siblings, 0 replies; 67+ messages in thread
From: Jernej Škrabec @ 2023-09-20 16:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Uwe Kleine-König
  Cc: Chen-Yu Tsai, Samuel Holland, linux-input, linux-arm-kernel,
	linux-sunxi, kernel

Dne sreda, 20. september 2023 ob 14:58:19 CEST je Uwe Kleine-König napisal(a):
> 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: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/input/serio/sun4i-ps2.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/serio/sun4i-ps2.c
> b/drivers/input/serio/sun4i-ps2.c index eb262640192e..aec66d9f5176 100644
> --- a/drivers/input/serio/sun4i-ps2.c
> +++ b/drivers/input/serio/sun4i-ps2.c
> @@ -297,7 +297,7 @@ static int sun4i_ps2_probe(struct platform_device *pdev)
> return error;
>  }
> 
> -static int sun4i_ps2_remove(struct platform_device *pdev)
> +static void sun4i_ps2_remove(struct platform_device *pdev)
>  {
>  	struct sun4i_ps2data *drvdata = platform_get_drvdata(pdev);
> 
> @@ -311,8 +311,6 @@ static int sun4i_ps2_remove(struct platform_device
> *pdev) iounmap(drvdata->reg_base);
> 
>  	kfree(drvdata);
> -
> -	return 0;
>  }
> 
>  static const struct of_device_id sun4i_ps2_match[] = {
> @@ -324,7 +322,7 @@ MODULE_DEVICE_TABLE(of, sun4i_ps2_match);
> 
>  static struct platform_driver sun4i_ps2_driver = {
>  	.probe		= sun4i_ps2_probe,
> -	.remove		= sun4i_ps2_remove,
> +	.remove_new	= sun4i_ps2_remove,
>  	.driver = {
>  		.name = DRIVER_NAME,
>  		.of_match_table = sun4i_ps2_match,





^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 02/52] input: cros_ec_keyb - Convert to platform remove callback returning void
  2023-09-20 12:57 ` [PATCH 02/52] input: cros_ec_keyb " Uwe Kleine-König
@ 2023-09-21  3:21   ` Tzung-Bi Shih
  0 siblings, 0 replies; 67+ messages in thread
From: Tzung-Bi Shih @ 2023-09-21  3:21 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Dmitry Torokhov, Benson Leung, Guenter Roeck, Greg Kroah-Hartman,
	Jonathan Cameron, joewu (吳仲振), linux-input,
	chrome-platform, kernel

On Wed, Sep 20, 2023 at 02:57:39PM +0200, 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>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 04/52] input: iqs62x-keys - Convert to platform remove callback returning void
  2023-09-20 12:57 ` [PATCH 04/52] input: iqs62x-keys " Uwe Kleine-König
@ 2023-09-21 11:29   ` Jeff LaBundy
  0 siblings, 0 replies; 67+ messages in thread
From: Jeff LaBundy @ 2023-09-21 11:29 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Dmitry Torokhov, Mattijs Korpershoek, linux-input, kernel

On Wed, Sep 20, 2023 at 02:57:41PM +0200, 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>

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  drivers/input/keyboard/iqs62x-keys.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
> index 02ceebad7bda..688d61244b5f 100644
> --- a/drivers/input/keyboard/iqs62x-keys.c
> +++ b/drivers/input/keyboard/iqs62x-keys.c
> @@ -310,7 +310,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int iqs62x_keys_remove(struct platform_device *pdev)
> +static void iqs62x_keys_remove(struct platform_device *pdev)
>  {
>  	struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev);
>  	int ret;
> @@ -319,8 +319,6 @@ static int iqs62x_keys_remove(struct platform_device *pdev)
>  						 &iqs62x_keys->notifier);
>  	if (ret)
>  		dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver iqs62x_keys_platform_driver = {
> @@ -328,7 +326,7 @@ static struct platform_driver iqs62x_keys_platform_driver = {
>  		.name = "iqs62x-keys",
>  	},
>  	.probe = iqs62x_keys_probe,
> -	.remove = iqs62x_keys_remove,
> +	.remove_new = iqs62x_keys_remove,
>  };
>  module_platform_driver(iqs62x_keys_platform_driver);
>  
> -- 
> 2.40.1
> 

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 00/52] input: Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (51 preceding siblings ...)
  2023-09-20 12:58 ` [PATCH 52/52] input: wm97xx-core " Uwe Kleine-König
@ 2023-09-24  2:48 ` Dmitry Torokhov
  2023-09-24 15:50   ` Uwe Kleine-König
  2023-11-13  3:23 ` patchwork-bot+chrome-platform
  2023-11-13  3:42 ` patchwork-bot+chrome-platform
  54 siblings, 1 reply; 67+ messages in thread
From: Dmitry Torokhov @ 2023-09-24  2:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Michael Hennerich, linux-input, kernel, Benson Leung,
	Guenter Roeck, Greg Kroah-Hartman, Jonathan Cameron,
	joewu (吳仲振), chrome-platform,
	Andy Shevchenko, Mattijs Korpershoek, Jeff LaBundy, Rob Herring,
	Siarhei Volkau, Pavel Machek, Steven Rostedt (Google),
	Paolo Abeni, Kalle Valo, Yangtao Li, ye xingchen, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel,
	Support Opensource, Andrey Moiseev, Lee Jones, Linus Walleij,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Hans de Goede, Miloslav Trmac, patches, Christophe JAILLET,
	Liang He, Chen Jun, Ruan Jinjie, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, linux-sunxi, Michal Simek, Robert Jarzmik,
	Dmitry Baryshkov, Arnd Bergmann, Rafael J. Wysocki,
	Krzysztof Kozlowski, Daniel Lezcano, Jonathan Corbet

On Wed, Sep 20, 2023 at 02:57:37PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> this series converts all platform drivers below drivers/input to use
> remove_new. The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> There are no interdependencies between the patches. As there are still
> quite a few drivers to convert, I'm happy about every patch that makes
> it in. So even if there is a merge conflict with one patch until you
> apply or a subject prefix is suboptimal, please apply the remainder of
> this series anyhow.

Applied the lot (fixing the i8042-sparcio patch subject), thank you!

-- 
Dmitry

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 00/52] input: Convert to platform remove callback returning void
  2023-09-24  2:48 ` [PATCH 00/52] input: " Dmitry Torokhov
@ 2023-09-24 15:50   ` Uwe Kleine-König
  2023-09-30 15:37     ` Dmitry Torokhov
  0 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-09-24 15:50 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Lee Jones, Linus Walleij, Alexandre Torgue, Pavel Machek,
	Guenter Roeck, Liang He, linux-stm32, Daniel Lezcano,
	chrome-platform, Arnd Bergmann, Samuel Holland, Andrey Moiseev,
	Michal Simek, Ruan Jinjie, Yangtao Li, Jernej Skrabec,
	joewu (吳仲振), Miloslav Trmac, Robert Jarzmik,
	Chen-Yu Tsai, Andy Gross, linux-input, Jeff LaBundy, linux-sunxi,
	linux-arm-msm, Maxime Coquelin, Michael Hennerich, Rob Herring,
	ye xingchen, Kalle Valo, Steven Rostedt (Google), Hans de Goede,
	Siarhei Volkau, Christophe JAILLET, Jonathan Cameron,
	Andy Shevchenko, Benson Leung, linux-arm-kernel, Paolo Abeni,
	Support Opensource, Chen Jun, Greg Kroah-Hartman,
	Mattijs Korpershoek, Rafael J. Wysocki, Konrad Dybcio,
	Krzysztof Kozlowski, kernel, patches, Dmitry Baryshkov,
	Jonathan Corbet, Bjorn Andersson

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

Hello Dmitry,

On Sat, Sep 23, 2023 at 07:48:21PM -0700, Dmitry Torokhov wrote:
> On Wed, Sep 20, 2023 at 02:57:37PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > this series converts all platform drivers below drivers/input to use
> > remove_new. The motivation is to get rid of an integer return code
> > that is (mostly) ignored by the platform driver core and error prone on
> > the driver side.
> > 
> > See commit 5c5a7680e67b ("platform: Provide a remove callback that
> > returns no value") for an extended explanation and the eventual goal.
> > 
> > There are no interdependencies between the patches. As there are still
> > quite a few drivers to convert, I'm happy about every patch that makes
> > it in. So even if there is a merge conflict with one patch until you
> > apply or a subject prefix is suboptimal, please apply the remainder of
> > this series anyhow.
> 
> Applied the lot (fixing the i8042-sparcio patch subject), thank you!

Thanks. In the meantime I found out why my process failed here: I only
fixed *.c, but this driver struct is defined in a header file
i8042-sparcio.h.

This file is only included by drivers/input/serio/i8042.h which in turn
is only included by drivers/input/serio/i8042.c. So there is only one
instance created, but I'd call that unusual anyhow.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 00/52] input: Convert to platform remove callback returning void
  2023-09-24 15:50   ` Uwe Kleine-König
@ 2023-09-30 15:37     ` Dmitry Torokhov
  0 siblings, 0 replies; 67+ messages in thread
From: Dmitry Torokhov @ 2023-09-30 15:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lee Jones, Linus Walleij, Alexandre Torgue, Pavel Machek,
	Guenter Roeck, Liang He, linux-stm32, Daniel Lezcano,
	chrome-platform, Arnd Bergmann, Samuel Holland, Andrey Moiseev,
	Michal Simek, Ruan Jinjie, Yangtao Li, Jernej Skrabec,
	joewu (吳仲振), Miloslav Trmac, Robert Jarzmik,
	Chen-Yu Tsai, Andy Gross, linux-input, Jeff LaBundy, linux-sunxi,
	linux-arm-msm, Maxime Coquelin, Michael Hennerich, Rob Herring,
	ye xingchen, Kalle Valo, Steven Rostedt (Google), Hans de Goede,
	Siarhei Volkau, Christophe JAILLET, Jonathan Cameron,
	Andy Shevchenko, Benson Leung, linux-arm-kernel, Paolo Abeni,
	Support Opensource, Chen Jun, Greg Kroah-Hartman,
	Mattijs Korpershoek, Rafael J. Wysocki, Konrad Dybcio,
	Krzysztof Kozlowski, kernel, patches, Dmitry Baryshkov,
	Jonathan Corbet, Bjorn Andersson

Hi Uwe,

Sorry for the spotty responses.

On Sun, Sep 24, 2023 at 05:50:57PM +0200, Uwe Kleine-König wrote:
> Hello Dmitry,
> 
> On Sat, Sep 23, 2023 at 07:48:21PM -0700, Dmitry Torokhov wrote:
> > On Wed, Sep 20, 2023 at 02:57:37PM +0200, Uwe Kleine-König wrote:
> > > Hello,
> > > 
> > > this series converts all platform drivers below drivers/input to use
> > > remove_new. The motivation is to get rid of an integer return code
> > > that is (mostly) ignored by the platform driver core and error prone on
> > > the driver side.
> > > 
> > > See commit 5c5a7680e67b ("platform: Provide a remove callback that
> > > returns no value") for an extended explanation and the eventual goal.
> > > 
> > > There are no interdependencies between the patches. As there are still
> > > quite a few drivers to convert, I'm happy about every patch that makes
> > > it in. So even if there is a merge conflict with one patch until you
> > > apply or a subject prefix is suboptimal, please apply the remainder of
> > > this series anyhow.
> > 
> > Applied the lot (fixing the i8042-sparcio patch subject), thank you!
> 
> Thanks. In the meantime I found out why my process failed here: I only
> fixed *.c, but this driver struct is defined in a header file
> i8042-sparcio.h.
> 
> This file is only included by drivers/input/serio/i8042.h which in turn
> is only included by drivers/input/serio/i8042.c. So there is only one
> instance created, but I'd call that unusual anyhow.

Right, i8042 is essentially a singleton, and what you see here is an
attempt to bolt OF onto a legacy driver that is largely predates the
current driver model. I wanted to clean it up, but it is still widely
used and I am hesitant to disturb it too much.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 00/52] input: Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (52 preceding siblings ...)
  2023-09-24  2:48 ` [PATCH 00/52] input: " Dmitry Torokhov
@ 2023-11-13  3:23 ` patchwork-bot+chrome-platform
  2023-11-13  3:42 ` patchwork-bot+chrome-platform
  54 siblings, 0 replies; 67+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-11-13  3:23 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: dmitry.torokhov, michael.hennerich, linux-input, kernel, bleung,
	groeck, gregkh, Jonathan.Cameron, joewu, chrome-platform,
	andriy.shevchenko, mkorpershoek, jeff, robh, lis8215, pavel,
	rostedt, pabeni, kvalo, frank.li, ye.xingchen, mcoquelin.stm32,
	alexandre.torgue, linux-stm32, linux-arm-kernel,
	support.opensource, o2g.org.ru, lee, linus.walleij, agross,
	andersson, konrad.dybcio, linux-arm-msm, hdegoede, mitr, patches,
	christophe.jaillet, windhl, chenjun102, ruanjinjie, wens,
	jernej.skrabec, samuel, linux-sunxi, michal.simek, robert.jarzmik,
	dmitry.baryshkov, arnd, rafael.j.wysocki, krzysztof.kozlowski,
	daniel.lezcano, corbet

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Dmitry Torokhov <dmitry.torokhov@gmail.com>:

On Wed, 20 Sep 2023 14:57:37 +0200 you wrote:
> Hello,
> 
> this series converts all platform drivers below drivers/input to use
> remove_new. The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> [...]

Here is the summary with links:
  - [02/52] input: cros_ec_keyb - Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/63ef64cb6453

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 67+ messages in thread

* Re: [PATCH 00/52] input: Convert to platform remove callback returning void
  2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (53 preceding siblings ...)
  2023-11-13  3:23 ` patchwork-bot+chrome-platform
@ 2023-11-13  3:42 ` patchwork-bot+chrome-platform
  54 siblings, 0 replies; 67+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-11-13  3:42 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: dmitry.torokhov, michael.hennerich, linux-input, kernel, bleung,
	groeck, gregkh, Jonathan.Cameron, joewu, chrome-platform,
	andriy.shevchenko, mkorpershoek, jeff, robh, lis8215, pavel,
	rostedt, pabeni, kvalo, frank.li, ye.xingchen, mcoquelin.stm32,
	alexandre.torgue, linux-stm32, linux-arm-kernel,
	support.opensource, o2g.org.ru, lee, linus.walleij, agross,
	andersson, konrad.dybcio, linux-arm-msm, hdegoede, mitr, patches,
	christophe.jaillet, windhl, chenjun102, ruanjinjie, wens,
	jernej.skrabec, samuel, linux-sunxi, michal.simek, robert.jarzmik,
	dmitry.baryshkov, arnd, rafael.j.wysocki, krzysztof.kozlowski,
	daniel.lezcano, corbet

Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Dmitry Torokhov <dmitry.torokhov@gmail.com>:

On Wed, 20 Sep 2023 14:57:37 +0200 you wrote:
> Hello,
> 
> this series converts all platform drivers below drivers/input to use
> remove_new. The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> [...]

Here is the summary with links:
  - [02/52] input: cros_ec_keyb - Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/63ef64cb6453

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2023-11-13  3:42 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 12:57 [PATCH 00/52] input: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 01/52] input: adp5520-keys - " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 02/52] input: cros_ec_keyb " Uwe Kleine-König
2023-09-21  3:21   ` Tzung-Bi Shih
2023-09-20 12:57 ` [PATCH 03/52] input: ep93xx_keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 04/52] input: iqs62x-keys " Uwe Kleine-König
2023-09-21 11:29   ` Jeff LaBundy
2023-09-20 12:57 ` [PATCH 05/52] input: matrix_keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 06/52] input: omap-keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 07/52] input: omap4-keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 08/52] input: samsung-keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 09/52] input: sh_keysc " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 10/52] input: spear-keyboard " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 11/52] input: stmpe-keypad " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 12/52] input: 88pm80x_onkey " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 13/52] input: da9052_onkey " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 14/52] input: da9055_onkey " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 15/52] input: ideapad_slidebar " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 16/52] input: m68kspkr " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 17/52] input: max8997_haptic " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 18/52] input: mc13783-pwrbutton " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 19/52] input: palmas-pwrbutton " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 20/52] input: pcap_keys " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 21/52] input: pcf50633-input " Uwe Kleine-König
2023-09-20 12:57 ` [PATCH 22/52] input: pcspkr " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 23/52] input: pm8941-pwrkey " Uwe Kleine-König
2023-09-20 13:03   ` Konrad Dybcio
2023-09-20 12:58 ` [PATCH 24/52] input: soc_button_array " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 25/52] input: sparcspkr " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 26/52] input: wistron_btns " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 27/52] input: wm831x-on " Uwe Kleine-König
2023-09-20 14:24   ` Charles Keepax
2023-09-20 12:58 ` [PATCH 28/52] input: navpoint " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 29/52] input: altera_ps2 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 30/52] input: ams_delta_serio " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 31/52] input: apbps2 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 32/52] input: arc_ps2 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 33/52] input: ct82c710 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: " Uwe Kleine-König
2023-09-20 13:06   ` Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 35/52] input: i8042 - " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 36/52] input: ioc3kbd " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 37/52] input: maceps2 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 38/52] input: olpc_apsp " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 39/52] input: ps2-gpio " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 40/52] input: q40kbd " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 41/52] input: rpckbd " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 42/52] input: sun4i-ps2 " Uwe Kleine-König
2023-09-20 16:07   ` Jernej Škrabec
2023-09-20 12:58 ` [PATCH 43/52] input: xilinx_ps2 " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 44/52] input: da9052_tsi " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 45/52] input: mainstone-wm97xx " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 46/52] input: mc13783_ts " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 47/52] input: pcap_ts " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 48/52] input: stmpe-ts " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 49/52] input: sun4i-ts " Uwe Kleine-König
2023-09-20 16:07   ` Jernej Škrabec
2023-09-20 12:58 ` [PATCH 50/52] input: ti_am335x_tsc " Uwe Kleine-König
2023-09-20 12:58 ` [PATCH 51/52] input: wm831x-ts " Uwe Kleine-König
2023-09-20 14:24   ` Charles Keepax
2023-09-20 12:58 ` [PATCH 52/52] input: wm97xx-core " Uwe Kleine-König
2023-09-20 14:24   ` Charles Keepax
2023-09-24  2:48 ` [PATCH 00/52] input: " Dmitry Torokhov
2023-09-24 15:50   ` Uwe Kleine-König
2023-09-30 15:37     ` Dmitry Torokhov
2023-11-13  3:23 ` patchwork-bot+chrome-platform
2023-11-13  3:42 ` patchwork-bot+chrome-platform

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).