From nobody Sun Feb 8 05:23:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 1AC9613C916 for ; Wed, 10 Apr 2024 07:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733449; cv=none; b=mJuH3tgQe7D00qow7aW5P/LOe1D1N3Q/DdTjiu4ONC4gLCUI5dx0DRvIjHJKwY7iqf1SiO+V2TWSbK8YKggS4CNHzDqhbbpIOM7q5q+GucGpUdVII1opcdTCYL6n3dXrlKXDv5HEgxplpnwWsgUdNTjkl7qm4/Zkoa/zF0YwPd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733449; c=relaxed/simple; bh=7M6GxdU+Qx1cq5JsMTSSXBCuCLJoumFg+NqADPAkAGE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dW/cV5e1ontJ8kFPOENJihGoJugYj7bj/PhxnApRJvgNYSJa+G2wsw1IvHzna4Zcz7raGLcc8kvBf+VenGPRcThejxHfdr5L489vHS2JUdur5Kx8LC64uC7Zag2anpHuzm/NTzDEBMNj26VwLZWlo9qtAnHye3RZhozhjjTbYY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1ruSCk-0007Oh-C6; Wed, 10 Apr 2024 09:17:10 +0200 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 1ruSCi-00BRwN-Sz; Wed, 10 Apr 2024 09:17:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1ruSCi-00HPjQ-2d; Wed, 10 Apr 2024 09:17:08 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/3] x86: platform: iris: Convert to platform remove callback returning void Date: Wed, 10 Apr 2024 09:16:51 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1671; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=7M6GxdU+Qx1cq5JsMTSSXBCuCLJoumFg+NqADPAkAGE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmFjzk8WXIlzsfdIcgLQ98mfT2M+ZRFfylvLnGB WqznffqRBmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZhY85AAKCRCPgPtYfRL+ TgrcB/95SwnDVkR6RLvGR9moOyosr/g6ZgoWP9EJxktRfkz9e4W2sd6hs/KXyZ5F+PABc034bmn 4G1r+unIG3Sxcs5zcxboZDyh3nDDzob1gj899YovU06z36uUZ14LWXhC6jxgqbaGm+GxTRmaKzd 08MO2NkSuswLMBxg4d1orDe5lisrhYx64Iu8sIlSWVXexoouNZ4g/IFsf4+zOroqgPomysQBlwf +ncjXcb/1XKkPbJ44sUI1qU2UOFBZL0u65U4+TEXAvGNawpMsVvTE4HKysnK4inQROJa5bHP0TA 9hNfsgH1dQg3HJw9bDBXkR8Mi9g1b4ObRDIClBkTo0TD3q/X 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 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 --- arch/x86/platform/iris/iris.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/platform/iris/iris.c b/arch/x86/platform/iris/iris.c index b42bfdab01a9..c5f3bbdbdcfe 100644 --- a/arch/x86/platform/iris/iris.c +++ b/arch/x86/platform/iris/iris.c @@ -62,11 +62,10 @@ static int iris_probe(struct platform_device *pdev) return 0; } =20 -static int iris_remove(struct platform_device *pdev) +static void iris_remove(struct platform_device *pdev) { pm_power_off =3D old_pm_power_off; printk(KERN_INFO "Iris power_off handler uninstalled.\n"); - return 0; } =20 static struct platform_driver iris_driver =3D { @@ -74,7 +73,7 @@ static struct platform_driver iris_driver =3D { .name =3D "iris", }, .probe =3D iris_probe, - .remove =3D iris_remove, + .remove_new =3D iris_remove, }; =20 static struct resource iris_resources[] =3D { --=20 2.43.0 From nobody Sun Feb 8 05:23:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 AB18913C919 for ; Wed, 10 Apr 2024 07:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733450; cv=none; b=im2LN2lcy1yhqO3Dy8nLbJo04BGkTV9/51hYC8D+APxfuXDOW85QdJIQizwUt96mUclH8KoGJUFnvRNf/FxgdvhLqmCy13gVI+x6BXbYpuBu6nK2t/l8pVJxdPTJQLoouiOdOP2b8Hfxw1QgiiRjYWgt8Q6ClvM4D7c3rVi+qHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733450; c=relaxed/simple; bh=xjGSy5q5TlMsAw/77BdDo4FYmGhQLPPWsYgO5Uu+b4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NI0QP/wUiG9V29Icjr2rBnvGJyHeDq2N8N/mmC2uXQS16dslAZEJLhTEMEiTcVi7lLAPtMSGM6s9jtqGVIc/GZQYdaIvBUEe/vv9uZM2AJfK5gv7mVzL1D3klUF8iA+lyP6yX5d49YMwP1tidlusTWjFYACbImmvGz4K/XZygEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1ruSCk-0007Oi-C6; Wed, 10 Apr 2024 09:17:10 +0200 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 1ruSCj-00BRwQ-25; Wed, 10 Apr 2024 09:17:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1ruSCi-00HPjV-3A; Wed, 10 Apr 2024 09:17:08 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/3] x86: platform: olpc-x01-pm: Convert to platform remove callback returning void Date: Wed, 10 Apr 2024 09:16:52 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2058; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=xjGSy5q5TlMsAw/77BdDo4FYmGhQLPPWsYgO5Uu+b4I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmFjzlRHNFNl8BBJRELTBYoYJ5tCmyJb6vKFGLk drInaCCh0GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZhY85QAKCRCPgPtYfRL+ Tue8CACeindFgQ3nJcnLoI8VB+H0oqYlk/qfdkSqXoliq4QbpWcpJ4+hdteAYcPj407aQk5z4GD 9t6LWltmahWiqteCBthP98xNUfdLedlg3+bb89h95oIXdQo+nDYf1ct0RB4ohwpgPH8J0/iNMJl ZW3KnSsusz4jPfAe4GMlZRKIV3Fyht9HOtExRqe519oaAQ2poVI18k9ZLVeuvdZPjgq9pja/HYQ op7XJ4wHOrmgeLVTZV+uvNnSUrw6WxrwES1OSLVOmv3QUKgKcYEfSzSTBFJ2eu+U7OKHUzHkHci cfDKAMkzIE+Lk9xKnOjmWFifZ9O+X1Gti/LDdodZY/AEpOyV 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 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 --- arch/x86/platform/olpc/olpc-xo1-pm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/platform/olpc/olpc-xo1-pm.c b/arch/x86/platform/olpc/= olpc-xo1-pm.c index f067ac780ba7..6a9c42de74e7 100644 --- a/arch/x86/platform/olpc/olpc-xo1-pm.c +++ b/arch/x86/platform/olpc/olpc-xo1-pm.c @@ -144,7 +144,7 @@ static int xo1_pm_probe(struct platform_device *pdev) return 0; } =20 -static int xo1_pm_remove(struct platform_device *pdev) +static void xo1_pm_remove(struct platform_device *pdev) { if (strcmp(pdev->name, "cs5535-pms") =3D=3D 0) pms_base =3D 0; @@ -152,7 +152,6 @@ static int xo1_pm_remove(struct platform_device *pdev) acpi_base =3D 0; =20 pm_power_off =3D NULL; - return 0; } =20 static struct platform_driver cs5535_pms_driver =3D { @@ -160,7 +159,7 @@ static struct platform_driver cs5535_pms_driver =3D { .name =3D "cs5535-pms", }, .probe =3D xo1_pm_probe, - .remove =3D xo1_pm_remove, + .remove_new =3D xo1_pm_remove, }; =20 static struct platform_driver cs5535_acpi_driver =3D { @@ -168,7 +167,7 @@ static struct platform_driver cs5535_acpi_driver =3D { .name =3D "olpc-xo1-pm-acpi", }, .probe =3D xo1_pm_probe, - .remove =3D xo1_pm_remove, + .remove_new =3D xo1_pm_remove, }; =20 static int __init xo1_pm_init(void) --=20 2.43.0 From nobody Sun Feb 8 05:23:52 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 24F2413C90E for ; Wed, 10 Apr 2024 07:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733448; cv=none; b=QkyLUAYiUqrK8gcBrGIlJqb7UrWpfjkgAy3NpMN7zq2My9MuXcTNWFW931w2t5srKLhOsWCqpKmxa1+f5+Oc8VHr9azyUb1SYMHwr3uDVkpmTUfOtn8nDRvefrQy2MerHhJTPCkdeCWjjSDTOrLynWjrS4WYuunFveop2b7cCtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712733448; c=relaxed/simple; bh=FZYfk1Hsrzp0URGjsfoL+rqF8k33Q3nofmMMSYezWc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sdmImO2Eo8ZF+swSnoF/479kkAV58hmLkwaFZZXxKvLWMvPskgErX9gV40fJX9W/iVybDGnKYNZsuIXvBwkKHuN4sGaMrp3hWjvJ4piRnArA7pyWNG/TIKL8jARLMgCYhI5QszJZ4k3w+y0orjY1trma/rY7Dg4kpFaHMMTGeTY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1ruSCk-0007Oj-C6; Wed, 10 Apr 2024 09:17:10 +0200 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 1ruSCj-00BRwT-7Y; Wed, 10 Apr 2024 09:17:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1ruSCj-00HPjZ-0U; Wed, 10 Apr 2024 09:17:09 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/3] x86: platform: olpc-xo1-sci: Convert to platform remove callback returning void Date: Wed, 10 Apr 2024 09:16:53 +0200 Message-ID: <63c9d1e6b07296916e4218c63f59a2dd6c6b6b16.1712732665.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=FZYfk1Hsrzp0URGjsfoL+rqF8k33Q3nofmMMSYezWc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmFjzmBZipNnJs1KOoDFs1Ui6idlkVW0oaQ5ejN LjqhwiJQm+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZhY85gAKCRCPgPtYfRL+ Thx+CACoBIAz2XK8MeCgcQupEQyzzkIh3vv1iYpKPXGj4XUxOcADxnxfvdK5QG/EKd+QM63Ex/H jjTMLkim/Pf47SCVHGfnhnlM+nL0rKsgOu5YqbBkE+5Oy5UJs7R3x8xmH9HWsmXcefCqLMEG08u M65rlCKaqqsxlAdZBmilR6j3ITOHIJsH9bsUUZada4gVx0IKIta2FXRB7Mb7jkczzDBzLQU6ARK foMKV/a2A+JxZWbd4hkSwaw8EUc7krGxygOBJZSj1h6pZDsJC0CejY29ZzBL9ahUf78a1FyxidP sU8JnTlQ9/KwvDCwWSDU89SzSJrO2AEOb97bKbPzYGiRI2H9 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 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 --- arch/x86/platform/olpc/olpc-xo1-sci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc= /olpc-xo1-sci.c index 89f25af4b3c3..46d42ff6e18a 100644 --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c @@ -598,7 +598,7 @@ static int xo1_sci_probe(struct platform_device *pdev) return r; } =20 -static int xo1_sci_remove(struct platform_device *pdev) +static void xo1_sci_remove(struct platform_device *pdev) { free_irq(sci_irq, pdev); cancel_work_sync(&sci_work); @@ -608,7 +608,6 @@ static int xo1_sci_remove(struct platform_device *pdev) free_ebook_switch(); free_power_button(); acpi_base =3D 0; - return 0; } =20 static struct platform_driver xo1_sci_driver =3D { @@ -617,7 +616,7 @@ static struct platform_driver xo1_sci_driver =3D { .dev_groups =3D lid_groups, }, .probe =3D xo1_sci_probe, - .remove =3D xo1_sci_remove, + .remove_new =3D xo1_sci_remove, .suspend =3D xo1_sci_suspend, .resume =3D xo1_sci_resume, }; --=20 2.43.0