From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D8C758F073 for ; Thu, 10 Sep 2026 19:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789067309; cv=none; b=SGNVykbmMvYOWnYatPnowVvw9bV5BxgtqELeg3dBL9ZtUhmd2ReCEmFxqOx3dkxA5DtLhzMY6Bf8eR7xRWQpZHciPOjJEOzd6FAGnNKan7x2Y0GXCrBwUZw8iQN+aYiCMnBz4FU4rIrlyKUiDSVMGIMatH3sFWphSbF04D9oNuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789067309; c=relaxed/simple; bh=UAF5ygAKHCzS0RVY90mdEAfWB4jmeVD3Zs/ZNffNGKs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u32987XfW3K4RN3aDofD4/NdL5UKjiIiWuxW+3h+7Clhha1fHikn3rhTH0s+m5iGkNemK5ha02YvN5oiB7mBHr6IKVJ5O+PAuU9M1UADdd+wt/QVhXIZMb9fwJin6yNqiZfhPVV4TK9JhodZc2Fs7uvJrPquCCAMICsD7psVkac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Il5+kHEG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Il5+kHEG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04D661F00893; Thu, 10 Sep 2026 19:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789067307; bh=OY9oUoOA6Or9BeAq9En2/3It/GRXE2SDHn0b0FVyJII=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Il5+kHEGB5tk2ONj98uavHja1YVct2+FFcqWSq8lE8mKTQtijIRvrgU80QDGyrb/p UvYoU2hCVZCfLQlYMP22mtMdw+HwJZ0B4SeLh744878Ca21AiTqh0I235ti3+eQs6r 1dQSUe4hdHXEATd7OkFmq6Z73pA+A5C7hw44GWDwFrEkhvBGHUwcyqA3Ky3LpLX3J2 o7CiTUYUC6orpYAApY2Pp9Ief1qz9nkSjKLdJ0/vkP2KVutz6r+HGOPmxE96gmsDje txNvYggoAdDrXJR25BNM2l1188yBpElyWXuWFIbXpynlTGlL88zItz5d6Tj18ZhEoi HZ7eIl+ujPP2g== From: Sasha Levin To: stable@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Alain Volmat , Ard Biesheuvel , Baruch Siach , Florian Fainelli , Heiko Stuebner , Jarkko Nikula , Jernej Skrabec , Jochen Friedrich , Peter Rosin , Vadim Pasternak , Asmaa Mnebhi , Bartosz Golaszewski , Chris Packham , Chris Pringle , Claudiu Beznea , Conor Dooley , Geert Uytterhoeven , Hans de Goede , Jean Delvare , Konrad Dybcio , Krzysztof Kozlowski , Linus Walleij , Martin Blumenstingl , Matthias Brugger , Patrice Chotard , Tali Perry , Vignesh Raghavendra , Wolfram Sang , Sasha Levin Subject: [PATCH 6.1.y 2/4] i2c: Convert to platform remove callback returning void Date: Thu, 10 Sep 2026 15:08:20 -0400 Message-ID: <20260910190822.1452673-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260910190822.1452673-1-sashal@kernel.org> References: <2026090909-unmarked-juggling-ce1d@gregkh> <20260910190822.1452673-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Uwe Kleine-König [ 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 Acked-by: Alain Volmat Acked-by: Ard Biesheuvel Acked-by: Baruch Siach Acked-by: Florian Fainelli Acked-by: Heiko Stuebner Acked-by: Jarkko Nikula Acked-by: Jernej Skrabec Acked-by: Jochen Friedrich Acked-by: Peter Rosin Acked-by: Vadim Pasternak Reviewed-by: Asmaa Mnebhi Reviewed-by: Bartosz Golaszewski Reviewed-by: Chris Packham Reviewed-by: Chris Pringle Reviewed-by: Claudiu Beznea Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Reviewed-by: Hans de Goede Reviewed-by: Jean Delvare Reviewed-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Reviewed-by: Martin Blumenstingl Reviewed-by: Matthias Brugger Reviewed-by: Patrice Chotard Reviewed-by: Tali Perry Reviewed-by: Vignesh Raghavendra Signed-off-by: Wolfram Sang For this stable dependency, retain only the Qualcomm CCI conversion. The GXP driver is absent from this tree, and the other I2C driver conversions are unrelated to the target autosuspend fix. Also adapt the probe/remove cleanup from upstream f0285c286bca5 ("i2c: qcom-cci: Remove overcautious disable_irq() calls"). The IRQ is already requested with devm_request_irq(), so devres releases it on probe failure and removal. Route both the existing cci_reset() and cci_init() failures to disable_clocks, and remove the redundant IRQ disables and error label. This supplies the context expected by f98d4986482151a835b521a734722fe8dc5ca37d without adding functions. 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. [ 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: f98d49864821 ("i2c: qcom-cci: fix autosuspend cleanup") Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-qcom-cci.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index 4989d0e705d71..58c1b034fc3a5 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -633,11 +633,11 @@ static int cci_probe(struct platform_device *pdev) ret = cci_reset(cci); if (ret < 0) - goto error; + goto disable_clocks; ret = cci_init(cci); if (ret < 0) - goto error; + goto disable_clocks; pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC); pm_runtime_use_autosuspend(dev); @@ -667,15 +667,13 @@ static int cci_probe(struct platform_device *pdev) of_node_put(cci->master[i].adap.dev.of_node); } } -error: - disable_irq(cci->irq); disable_clocks: cci_disable_clocks(cci); return ret; } -static int cci_remove(struct platform_device *pdev) +static void cci_remove(struct platform_device *pdev) { struct cci *cci = platform_get_drvdata(pdev); int i; @@ -688,11 +686,8 @@ static int cci_remove(struct platform_device *pdev) } } - disable_irq(cci->irq); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - - return 0; } static const struct cci_data cci_v1_data = { @@ -823,7 +818,7 @@ MODULE_DEVICE_TABLE(of, cci_dt_match); static struct platform_driver qcom_cci_driver = { .probe = cci_probe, - .remove = cci_remove, + .remove_new = cci_remove, .driver = { .name = "i2c-qcom-cci", .of_match_table = cci_dt_match, -- 2.53.0