From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Andre Przywara" <andre.przywara@arm.com>,
"Mark Brown" <broonie@kernel.org>,
"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 6.1.y 1/3] spi: sun4i: Convert to platform remove callback returning void
Date: Wed, 13 May 2026 13:44:59 -0400 [thread overview]
Message-ID: <20260513174501.3896424-1-sashal@kernel.org> (raw)
In-Reply-To: <2026051252-unproven-faculty-80e7@gregkh>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[ Upstream commit b7b949458ac391963e56ae354b73fee63016dcee ]
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20230303172041.2103336-75-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 42108a2f03e0 ("spi: sun4i: fix controller deregistration")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sun4i.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 6937f5c4d868f..b7ce4ff91193d 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -519,11 +519,9 @@ static int sun4i_spi_probe(struct platform_device *pdev)
return ret;
}
-static int sun4i_spi_remove(struct platform_device *pdev)
+static void sun4i_spi_remove(struct platform_device *pdev)
{
pm_runtime_force_suspend(&pdev->dev);
-
- return 0;
}
static const struct of_device_id sun4i_spi_match[] = {
@@ -539,7 +537,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
static struct platform_driver sun4i_spi_driver = {
.probe = sun4i_spi_probe,
- .remove = sun4i_spi_remove,
+ .remove_new = sun4i_spi_remove,
.driver = {
.name = "sun4i-spi",
.of_match_table = sun4i_spi_match,
--
2.53.0
next prev parent reply other threads:[~2026-05-13 17:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 12:45 FAILED: patch "[PATCH] spi: sun4i: fix controller deregistration" failed to apply to 6.1-stable tree gregkh
2026-05-13 17:44 ` Sasha Levin [this message]
2026-05-13 17:45 ` [PATCH 6.1.y 2/3] spi: sun4i: switch to use modern name Sasha Levin
2026-05-13 17:45 ` [PATCH 6.1.y 3/3] spi: sun4i: fix controller deregistration 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=20260513174501.3896424-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andre.przywara@arm.com \
--cc=broonie@kernel.org \
--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