Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.6.y 1/6] Input: matrix_keypad - convert to platform remove callback returning void
Date: Tue, 10 Nov 2026 21:03:36 -0500	[thread overview]
Message-ID: <20261111020056.444668-1-sashal@kernel.org> (raw)
In-Reply-To: <20261107053642-failed-6.6-1527451f87df@kernel.org>

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

[ Upstream commit af90388a598d39584283c18e4047124fee8f1801 ]

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>
Link: https://lore.kernel.org/r/20230920125829.1478827-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Stable-dep-of: 1527451f87df ("Revert "Input: matrix_keypad - force switch rows to input mode"")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 a1b037891af25..50fa764c82d2b 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.53.0


  reply	other threads:[~2026-11-11  2:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 10:36 FAILED: patch "[PATCH] Revert "Input: matrix_keypad - force switch rows to input mode"" failed to apply to 6.6-stable tree Sasha Levin
2026-11-11  2:03 ` Sasha Levin [this message]
2026-11-11  2:03   ` [PATCH 6.6.y 2/6] Input: matrix_keypad - avoid repeatedly converting GPIO to IRQ Sasha Levin
2026-11-11  2:03   ` [PATCH 6.6.y 3/6] Input: matrix_keypad - consolidate handling of clustered interrupt Sasha Levin
2026-11-11  2:03   ` [PATCH 6.6.y 4/6] Input: matrix_keypad - switch to using managed resources Sasha Levin
2026-11-11  2:03   ` [PATCH 6.6.y 5/6] Input: matrix_keypad - remove support for clustered interrupt Sasha Levin
2026-11-11  2:03   ` [PATCH 6.6.y 6/6] Revert "Input: matrix_keypad - force switch rows to input mode" Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261111020056.444668-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox