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>,
	"Alain Volmat" <alain.volmat@foss.st.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Baruch Siach" <baruch@tkos.co.il>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Jochen Friedrich" <jochen@scram.de>,
	"Peter Rosin" <peda@axentia.se>,
	"Vadim Pasternak" <vadimp@nvidia.com>,
	"Asmaa Mnebhi" <asnaa@nvidia.com>,
	"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>,
	"Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Chris Pringle" <chris.pringle@phabrix.com>,
	"Claudiu Beznea" <claudiu.beznea@microchip.com>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Jean Delvare" <jdelvare@suse.de>,
	"Konrad Dybcio" <konrad.dybcio@linaro.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Tali Perry" <tali.perry@nuvoton.com>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Wolfram Sang" <wsa@kernel.org>,
	"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 5.15.y 2/3] i2c: Convert to platform remove callback returning void
Date: Tue, 22 Sep 2026 13:00:46 -0400	[thread overview]
Message-ID: <20260922170047.3183673-2-sashal@kernel.org> (raw)
In-Reply-To: <20260922170047.3183673-1-sashal@kernel.org>

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

[ Upstream commit e190a0c389e60178fba3d532abf936dcae223e7d ]

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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Peter Rosin <peda@axentia.se>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Asmaa Mnebhi <asnaa@nvidia.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Chris Pringle <chris.pringle@phabrix.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Tali Perry <tali.perry@nuvoton.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

Stable adaptation for e0c3e9d76adb ("i2c: imx: disable autosuspend on
remove"): retain only the i.MX remove callback conversion needed by the
target. Drop the GXP conversion because this stable tree has no GXP I2C
driver, and omit the other unrelated driver conversions. The platform
core already supports .remove_new; no new functions are needed. Keep the
existing runtime-PM annotations so configurations without CONFIG_PM
remain supported.

[ sashal: Reduced backport -- upstream e190a0c389e60 touches 88 file(s), this
  backport carries 1. Not backported here:
  drivers/i2c/busses/i2c-altera.c
  drivers/i2c/busses/i2c-amd-mp2-plat.c
  drivers/i2c/busses/i2c-aspeed.c
  drivers/i2c/busses/i2c-at91-core.c
  drivers/i2c/busses/i2c-au1550.c
  drivers/i2c/busses/i2c-axxia.c
  drivers/i2c/busses/i2c-bcm2835.c
  drivers/i2c/busses/i2c-bcm-iproc.c
  ... and 79 more
  This note is generated from the file lists only; see the resolution record
  for the reasoning. ]

Stable-dep-of: e0c3e9d76adb ("i2c: imx: disable autosuspend on remove")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/i2c/busses/i2c-imx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index cda7662e35bd6..f59dcd3aca0a5 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1591,7 +1591,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int i2c_imx_remove(struct platform_device *pdev)
+static void i2c_imx_remove(struct platform_device *pdev)
 {
 	struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
 	int irq, ret;
@@ -1625,8 +1625,6 @@ static int i2c_imx_remove(struct platform_device *pdev)
 
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
@@ -1657,7 +1655,7 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
 
 static struct platform_driver i2c_imx_driver = {
 	.probe = i2c_imx_probe,
-	.remove = i2c_imx_remove,
+	.remove_new = i2c_imx_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.pm = &i2c_imx_pm_ops,
-- 
2.53.0


  reply	other threads:[~2026-09-22 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  9:39 FAILED: patch "[PATCH] i2c: imx: disable autosuspend on remove" failed to apply to 5.15-stable tree gregkh
2026-09-22 17:00 ` [PATCH 5.15.y 1/3] i2c: omap: Improve error reporting for problems during .remove() Sasha Levin
2026-09-22 17:00   ` Sasha Levin [this message]
2026-09-22 17:00   ` [PATCH 5.15.y 3/3] i2c: imx: disable autosuspend on remove 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=20260922170047.3183673-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alain.volmat@foss.st.com \
    --cc=ardb@kernel.org \
    --cc=asnaa@nvidia.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=baruch@tkos.co.il \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=chris.pringle@phabrix.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=conor.dooley@microchip.com \
    --cc=f.fainelli@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hdegoede@redhat.com \
    --cc=heiko@sntech.de \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=jernej.skrabec@gmail.com \
    --cc=jochen@scram.de \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=peda@axentia.se \
    --cc=stable@vger.kernel.org \
    --cc=tali.perry@nuvoton.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vadimp@nvidia.com \
    --cc=vigneshr@ti.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

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

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