From nobody Sun Dec 28 21:19:48 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE9B6C10F04 for ; Tue, 5 Dec 2023 12:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235159AbjLEM0h (ORCPT ); Tue, 5 Dec 2023 07:26:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231897AbjLEM0c (ORCPT ); Tue, 5 Dec 2023 07:26:32 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 655CAC9 for ; Tue, 5 Dec 2023 04:26:38 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rAUVY-0005YB-DY; Tue, 05 Dec 2023 13:26:36 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAUVY-00Djv9-0j; Tue, 05 Dec 2023 13:26:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAUVX-00EhQy-OG; Tue, 05 Dec 2023 13:26:35 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 7/8] regulator: virtual: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:22 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1830; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=1OKfIPBeDkKIREgYV7LXbr/0td99Z79KwgLwoughZ/c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbuOE/46ozZYuwEBtuuizP6Db361dH5Sjxp+ Slow9GJVjeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W7gAKCRCPgPtYfRL+ TmwIB/wJ6YpQ2ODQNk1jeVFJkg/vHO2WmI6bTHeiE1UEBDv3ANOfLiYCgutRQsfrDuzLocHJtF0 AEs1cdzNB5wQY5HtKvILN9fDWyidpJPwtG3Zygn1MHiEiOjmSsA364LJdS+hviBCGw+Xsa9B0FN zbCqA6olDtPyDCvo2C0Kz6oA3NH9Jlknhxqk03o2q8ayvEoCIvKf7I8uRHOYBuOTxiwRsz9/vrl qVeJhH4DGsPUz9jt36MBGXgfZYIe4PWb/oonaWO2mWv1oxl6FM2lCtHk5cYxViy0kpVtWb0D+YA V00SHr+iaR43hrxfthWVFdCA4uFAJLxNBVwubf0D8mG4w51T X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=C3=B6nig --- drivers/regulator/virtual.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index d5a160efdae6..0a0ee186c6af 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c @@ -345,7 +345,7 @@ static int regulator_virtual_probe(struct platform_devi= ce *pdev) return 0; } =20 -static int regulator_virtual_remove(struct platform_device *pdev) +static void regulator_virtual_remove(struct platform_device *pdev) { struct virtual_consumer_data *drvdata =3D platform_get_drvdata(pdev); =20 @@ -353,13 +353,11 @@ static int regulator_virtual_remove(struct platform_d= evice *pdev) =20 if (drvdata->enabled) regulator_disable(drvdata->regulator); - - return 0; } =20 static struct platform_driver regulator_virtual_consumer_driver =3D { .probe =3D regulator_virtual_probe, - .remove =3D regulator_virtual_remove, + .remove_new =3D regulator_virtual_remove, .driver =3D { .name =3D "reg-virt-consumer", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, --=20 2.42.0