From nobody Sat Dec 27 20:56:20 2025 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 A7B763066A for ; Fri, 15 Dec 2023 13:59:37 +0000 (UTC) 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 1rE8iu-0002lL-Sz; Fri, 15 Dec 2023 14:59:28 +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 1rE8it-00G2ZG-QJ; Fri, 15 Dec 2023 14:59:27 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8it-003cC2-GP; Fri, 15 Dec 2023 14:59:27 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Shuai Xue , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/18] perf: alibaba_uncore_drw: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:01 +0100 Message-ID: X-Mailer: git-send-email 2.42.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=1930; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=9FC259Rv6/1RNxYI95FF5rVsM1/6UsMv70AkNQrVF1Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFulZf+lV8nfqy5ovLYczr2QJtaFXTDh+Ik2H irgtecLXjeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbpQAKCRCPgPtYfRL+ TrhnCACSDh21/DkEFLG9vdQ8DL85RDI9U9NJtmDImJCs1mt5MmHxD7nUcmXvAVxOW7SkVdNhReG MScmbD3s1L3D/usi78y8fSzSfTv4jqbCYRQrcMPStisxaxQjSlq/OwsfE7GBURPUjjT2Z6sffjr eWr+Qy1P5EcqPhiaTqlejucbGrR0qOJhppx1mkE0RpCoa/l9DOzrOZ6qK0jZ37TzjEJJL3TMO4B bkVE35ZkgAYM3iL6ovK3PXvy7NFhp5aFzjDiO0AzgVj5aWiPT/DTjl8NGF4fo2AiOgeUuVud0HO ynbJpiHs8g8kvs17Bxg+eqZj/Lp51b0Fbcr+sBs4YlBfHz7M 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 --- drivers/perf/alibaba_uncore_drw_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_u= ncore_drw_pmu.c index 19d459a36be5..a9277dcf90ce 100644 --- a/drivers/perf/alibaba_uncore_drw_pmu.c +++ b/drivers/perf/alibaba_uncore_drw_pmu.c @@ -729,7 +729,7 @@ static int ali_drw_pmu_probe(struct platform_device *pd= ev) return ret; } =20 -static int ali_drw_pmu_remove(struct platform_device *pdev) +static void ali_drw_pmu_remove(struct platform_device *pdev) { struct ali_drw_pmu *drw_pmu =3D platform_get_drvdata(pdev); =20 @@ -739,8 +739,6 @@ static int ali_drw_pmu_remove(struct platform_device *p= dev) =20 ali_drw_pmu_uninit_irq(drw_pmu); perf_pmu_unregister(&drw_pmu->pmu); - - return 0; } =20 static int ali_drw_pmu_offline_cpu(unsigned int cpu, struct hlist_node *no= de) @@ -795,7 +793,7 @@ static struct platform_driver ali_drw_pmu_driver =3D { .acpi_match_table =3D ali_drw_acpi_match, }, .probe =3D ali_drw_pmu_probe, - .remove =3D ali_drw_pmu_remove, + .remove_new =3D ali_drw_pmu_remove, }; =20 static int __init ali_drw_pmu_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 1C6E036AEC for ; Fri, 15 Dec 2023 13:59:41 +0000 (UTC) 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 1rE8iv-0002lM-3E; Fri, 15 Dec 2023 14:59:29 +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 1rE8iu-00G2ZJ-5O; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8it-003cC6-RU; Fri, 15 Dec 2023 14:59:27 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Jiucheng Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/18] perf: amlogic: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:02 +0100 Message-ID: <33dbadf246eb323edd9e09ac744111216c167a55.1702648124.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1758; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=JQzThqbYJP0QqESsItg7VkQxjf7NhjUZgsGroMmrOZc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFunAL8ycJpqtt6tJDjG+TMfdjLtm1rASeztS gl+kihZlRqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbpwAKCRCPgPtYfRL+ TohvCACm7G4Swx+T76FjE6UsHXXIG1J+cbT4v9Z3seGjq6SJJgxd/XZI+9sThyUM0hr75yQ+KpS jE0G6cKisaCLXR79HtR5VSEvyrG7PhR6WMmKdDI+pBmcfP5v3XQ69go7jN9lLOEt4oPYIU5iYbJ XunL0YeN0g0LeGgz9Gkk7FmM4LPwIyF+a2+3kHbrFww67ebezxwk5CWO6LQeMAc2NxnUJCLnW4z yZAIEt5KxjFywnR3E9IwFoq9d0jUKGig/POvSBV9AihktZICVmOoVYdMNZd0ET96RzGJUPBGs1x vrxU0Ykd14+Mfgv6oNbwZaIw96Aj6yDImRvhOCTpJyDXxOv8 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 --- drivers/perf/amlogic/meson_g12_ddr_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/amlogic/meson_g12_ddr_pmu.c b/drivers/perf/amlogi= c/meson_g12_ddr_pmu.c index 15d52ab3276a..99cc791892bc 100644 --- a/drivers/perf/amlogic/meson_g12_ddr_pmu.c +++ b/drivers/perf/amlogic/meson_g12_ddr_pmu.c @@ -355,11 +355,9 @@ static int g12_ddr_pmu_probe(struct platform_device *p= dev) return meson_ddr_pmu_create(pdev); } =20 -static int g12_ddr_pmu_remove(struct platform_device *pdev) +static void g12_ddr_pmu_remove(struct platform_device *pdev) { meson_ddr_pmu_remove(pdev); - - return 0; } =20 static const struct of_device_id meson_ddr_pmu_dt_match[] =3D { @@ -381,7 +379,7 @@ MODULE_DEVICE_TABLE(of, meson_ddr_pmu_dt_match); =20 static struct platform_driver g12_ddr_pmu_driver =3D { .probe =3D g12_ddr_pmu_probe, - .remove =3D g12_ddr_pmu_remove, + .remove_new =3D g12_ddr_pmu_remove, =20 .driver =3D { .name =3D "meson-g12-ddr-pmu", --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 356C52EB0C for ; Fri, 15 Dec 2023 13:59:34 +0000 (UTC) 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 1rE8iu-0002lN-T6; Fri, 15 Dec 2023 14:59:28 +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 1rE8iu-00G2ZM-Fs; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCA-6O; Fri, 15 Dec 2023 14:59:28 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/18] perf: arm-cci: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:03 +0100 Message-ID: <70b581d58cfffdccb9fb3ed17bf3220c00f8033f.1702648124.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1733; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=OV7M65VoRPeJ8qTDzcFPkay5azPTFOLc6r+glQI271o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuogdGltz/NA/M9cJo+jkIVbz1EYKIyaZhCh 4ZCdvCuODCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqAAKCRCPgPtYfRL+ TkIPB/9K2n7gMNOMWl/EmTYhk5IAPdnBM9fF+pHuMPwmfcFW+Wson4Ic7Y2+x7Rm/Ca/gLzRboB wEjcoZpsPJXtKRihv0dBETuhO5mGrDv/GSIv4T2hPihADs+UyBRG/AT64Igh0NiXQaRuq3LRd3L wDC+Pyry+EZcPk1PcwIGhzcXtTuOriyvJs/xeI1Rj56DlCfdHnCwmlyh2Li7HLrF1CfHnzYPQsz 03aFqQpabdqBZFHMoadpgb0BySMFm6ScfKq5b6ZcQQU3pWm6kz5ouETWEu7UuPetw98bdkJ1e1Y H1BK6h6tIus1cC4lYHZw5geWq1nw0Of3UJC4Bg2uXeaQ0T7m 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 --- drivers/perf/arm-cci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 61de861eaf91..6be03f81ae5d 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c @@ -1697,16 +1697,14 @@ static int cci_pmu_probe(struct platform_device *pd= ev) return ret; } =20 -static int cci_pmu_remove(struct platform_device *pdev) +static void cci_pmu_remove(struct platform_device *pdev) { if (!g_cci_pmu) - return 0; + return; =20 cpuhp_remove_state(CPUHP_AP_PERF_ARM_CCI_ONLINE); perf_pmu_unregister(&g_cci_pmu->pmu); g_cci_pmu =3D NULL; - - return 0; } =20 static struct platform_driver cci_pmu_driver =3D { @@ -1716,7 +1714,7 @@ static struct platform_driver cci_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D cci_pmu_probe, - .remove =3D cci_pmu_remove, + .remove_new =3D cci_pmu_remove, }; =20 module_platform_driver(cci_pmu_driver); --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 356842EAF9 for ; Fri, 15 Dec 2023 13:59:34 +0000 (UTC) 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 1rE8iv-0002lY-9F; Fri, 15 Dec 2023 14:59:29 +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 1rE8iu-00G2ZP-Sd; Fri, 15 Dec 2023 14:59:28 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCE-IY; Fri, 15 Dec 2023 14:59:28 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/18] perf: arm-ccn: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:04 +0100 Message-ID: <1cae5f0c4693333c91d28a09388bdb8bfcc25d0b.1702648124.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1666; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=IwQvPM4pMNjqoaU/SqDrjyHMmEbaSTKuNL+vegcPc2I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFupYABrQduygxr1ltHykST+B0mPQoklrnDBG bTOaFpan+WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqQAKCRCPgPtYfRL+ TuAUB/4/LXliwKSYyXg5BPZr0LBpWT4xzVXi+BVU4gpFMmKpRO1EoCFaXXUB2WJJRvgKrbSDZdF hdaS7h90V4etgGoogeb6a8dOsYtsc0oPGBgsZqyzSYNGvBFFtPcLHRyR9q4buCue+hpq0IqSWRy HTbzLk3XFFyW/EHNi1t6vg2MDqGADWSPePyAEQipWYEuf5gvg9LqYhaOLQssfBOwaEsCcRfhNKj fm2mjdnAeVefrZwEdFgRXok7PFXfVPSm9GXtp43qNpN+6D06GUfJswdfF6VZtt+jrfqL/P/BZ7t pWvs7o77DmyiXM7RgeZ22feiP48fJTidYe8IZC1xarRlole1 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 --- drivers/perf/arm-ccn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 728d13d8e98a..641471bd5eff 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -1515,13 +1515,11 @@ static int arm_ccn_probe(struct platform_device *pd= ev) return arm_ccn_pmu_init(ccn); } =20 -static int arm_ccn_remove(struct platform_device *pdev) +static void arm_ccn_remove(struct platform_device *pdev) { struct arm_ccn *ccn =3D platform_get_drvdata(pdev); =20 arm_ccn_pmu_cleanup(ccn); - - return 0; } =20 static const struct of_device_id arm_ccn_match[] =3D { @@ -1539,7 +1537,7 @@ static struct platform_driver arm_ccn_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D arm_ccn_probe, - .remove =3D arm_ccn_remove, + .remove_new =3D arm_ccn_remove, }; =20 static int __init arm_ccn_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 7D1CD2D7AA for ; Fri, 15 Dec 2023 13:59:35 +0000 (UTC) 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 1rE8iv-0002lj-IB; Fri, 15 Dec 2023 14:59:29 +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 1rE8iv-00G2ZU-5G; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iu-003cCI-SF; Fri, 15 Dec 2023 14:59:28 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/18] perf: arm-cmn: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:05 +0100 Message-ID: <8698ca612e17292f8a8bbb2d1c0f6be4b2053da7.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1819; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=rdvhYagiU3f/ZvfHEseZfXcXHLBGbSqUlVpPbtXCZfM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuqSs0T4Sqze1XzrLbcw0LPpYHBxuClmaojU 0kwcLgxM8KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqgAKCRCPgPtYfRL+ TmbECACHZbdkhVZnAkBCNBCLANRJrzUadl+dzu25xhZvyB9/uIWNlXBvRnMj5MQG6TjIjSfxmlJ NnqOOaQQjmkzP/LxNGZpA1EBnV5kXk1YowHg8Yp7Kc2D7IyLvIC1CFkGbevgAf/WDbGDh0i0Gg5 j1CIFSo18JIT4KPN11gtwdXaFGrCM9mEIfbqwpGjo3lehyBSooAgYY6xdBSg8JYn8Y5lCaENi/d Gqc90zCWQ6kPHCn0BXILApkXFRXxt+Hl07qJa2So8NP23XUPP0K5oSewtpSGZkwol+pA8CRScXl sKgo4wvu1y2zEKt+al71hbBzKAqMaMT4Sq3J4JqN+D8yNBLS 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 --- drivers/perf/arm-cmn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index c584165b13ba..ac7a953fe902 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -2504,7 +2504,7 @@ static int arm_cmn_probe(struct platform_device *pdev) return err; } =20 -static int arm_cmn_remove(struct platform_device *pdev) +static void arm_cmn_remove(struct platform_device *pdev) { struct arm_cmn *cmn =3D platform_get_drvdata(pdev); =20 @@ -2513,7 +2513,6 @@ static int arm_cmn_remove(struct platform_device *pde= v) perf_pmu_unregister(&cmn->pmu); cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); debugfs_remove(cmn->debug); - return 0; } =20 #ifdef CONFIG_OF @@ -2544,7 +2543,7 @@ static struct platform_driver arm_cmn_driver =3D { .acpi_match_table =3D ACPI_PTR(arm_cmn_acpi_match), }, .probe =3D arm_cmn_probe, - .remove =3D arm_cmn_remove, + .remove_new =3D arm_cmn_remove, }; =20 static int __init arm_cmn_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 B10BF34CEF for ; Fri, 15 Dec 2023 13:59:40 +0000 (UTC) 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 1rE8iw-0002lt-07; Fri, 15 Dec 2023 14:59:30 +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 1rE8iv-00G2ZZ-GT; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCM-6y; Fri, 15 Dec 2023 14:59:29 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Ilkka Koskinen , Suzuki K Poulose , Besar Wicaksono , Robin Murphy , Raag Jadav , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/18] perf: arm_cspmu: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:06 +0100 Message-ID: <9ff5a467569dd51b2fc44e11594ad5db7ea15f57.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1848; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=iD85+6TB8xZ09uwwdBXf03XK6NMXrN2+ozmtzMTXttY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFur3mWCsTZ86/mocSQ45ul+pTIzr/UQuUm4F y0mpEKykPeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbqwAKCRCPgPtYfRL+ Tq6oCACP7hKGGnlzlmcvQgf4nkNUaeLKlAPgMCQdyZ0osuj2C2NgpL1+vFuAF49i+xnFDzSWHx5 cFIdv+uqL1DQYFS7IQtjXivdUirncexZl8ICb771sPGL04cEHuD64Wu9Rz+bvVMGvQubWywHjE7 C9OxuDIJTeRKBJAFuQU1tVOIZwGhkKqlsI8pDPaXkhuTxQ/I2l4hsYw0ylM4v2ZvSc+aKAxHocl aPeWW8BWq4toRCOGsN3lrJFEOKy4Li4C1BZIt/hqmjN/NPc3c3ldakJjkp908CbIiHeL4lBIHEF a0PIaknWlp/z9xDdH9nCXSHGXfh9Mlof++TiXd6u7WC28sR+ 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 --- drivers/perf/arm_cspmu/arm_cspmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/ar= m_cspmu.c index 50b89b989ce7..3513bf50fefa 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -1252,14 +1252,12 @@ static int arm_cspmu_device_probe(struct platform_d= evice *pdev) return ret; } =20 -static int arm_cspmu_device_remove(struct platform_device *pdev) +static void arm_cspmu_device_remove(struct platform_device *pdev) { struct arm_cspmu *cspmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&cspmu->pmu); cpuhp_state_remove_instance(arm_cspmu_cpuhp_state, &cspmu->cpuhp_node); - - return 0; } =20 static const struct platform_device_id arm_cspmu_id[] =3D { @@ -1274,7 +1272,7 @@ static struct platform_driver arm_cspmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D arm_cspmu_device_probe, - .remove =3D arm_cspmu_device_remove, + .remove_new =3D arm_cspmu_device_remove, .id_table =3D arm_cspmu_id, }; =20 --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 AC4502EAE6 for ; Fri, 15 Dec 2023 13:59:35 +0000 (UTC) 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 1rE8iw-0002lz-8X; Fri, 15 Dec 2023 14:59:30 +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 1rE8iv-00G2Zd-RV; Fri, 15 Dec 2023 14:59:29 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCQ-Hw; Fri, 15 Dec 2023 14:59:29 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/18] perf: arm_dmc620: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:07 +0100 Message-ID: <20cc24ede88f5e000991dfe6f4cf1222b819e337.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1931; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=lrV81L2OU/dvTSZ+m0J3yiXdNzi3SVAwtIWN5qo5KWw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFutwo9RDJJfKqAgN3OJB85XfTtj7FOxqzbbo dBmPHTBK9+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrQAKCRCPgPtYfRL+ Tq9aB/98q4eICU9u2Q8WbuK24DRNwAR7/EYcGfG1LYDS2Wn1ZDjBkadAlR6sAmTwHAmBsbpEoWx ikFeZHGtwu8wy8va+x8OsWplfaYy87dON9XMRWhsTMswN3jbRRFmUwTuwkmnNn9s8PL8Be1t1gm 6YzUoYZpe3a4G3xPzqxJvFrUoSfYYTjoA1tsRR4rg0NOf8BrrJBHuPqCUtk/bqbHICiPYx6ZZQK GAoZ9sz+qxK25T+Jh5dDid9YjmJwCTPsMY9zP9skHdLaW2vo/uDCBKfpNLOmisknHzw24/DjZe2 VOqpLt1C8WXi53xpHtr7UDEH8dvUZk+J88g+f+lCVxNbJ2eA 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 --- drivers/perf/arm_dmc620_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 30cea6859574..8a81be2dd5ec 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -724,7 +724,7 @@ static int dmc620_pmu_device_probe(struct platform_devi= ce *pdev) return ret; } =20 -static int dmc620_pmu_device_remove(struct platform_device *pdev) +static void dmc620_pmu_device_remove(struct platform_device *pdev) { struct dmc620_pmu *dmc620_pmu =3D platform_get_drvdata(pdev); =20 @@ -732,8 +732,6 @@ static int dmc620_pmu_device_remove(struct platform_dev= ice *pdev) =20 /* perf will synchronise RCU before devres can free dmc620_pmu */ perf_pmu_unregister(&dmc620_pmu->pmu); - - return 0; } =20 static const struct acpi_device_id dmc620_acpi_match[] =3D { @@ -748,7 +746,7 @@ static struct platform_driver dmc620_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D dmc620_pmu_device_probe, - .remove =3D dmc620_pmu_device_remove, + .remove_new =3D dmc620_pmu_device_remove, }; =20 static int __init dmc620_pmu_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 DA9F32EB13 for ; Fri, 15 Dec 2023 13:59:35 +0000 (UTC) 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 1rE8iw-0002m9-KH; Fri, 15 Dec 2023 14:59:30 +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 1rE8iw-00G2Zh-6a; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iv-003cCU-T8; Fri, 15 Dec 2023 14:59:29 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/18] perf: arm_dsu: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:08 +0100 Message-ID: <1eda5e216afcb0e26a50e9be112d4514ffd0844a.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1833; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=gKSz5agc738Ao0P2osYXM1UoZoFjy/rLUQ5L4iZFmyI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuu4w/8xSjfL5Jy4Q+gBWkJl5quzF8u2c9EF ZSuJkFazxuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrgAKCRCPgPtYfRL+ TnOwCACE2E0Wcd9duOUJS8zMVcNOKoztafxCDtZwFHXmU9Uad7QEAI0yl4pvEb5PKqJKWNqFfRO B3u9lOiEFQy6jStJIZMkq0RR5R0h4wwib+AX5JzwbARfq8QHxivZkuE8A/kcq5YaXJ50hkCSejm LWFWQEEFRBvD6lF52g6PwP7sEp9r5tBXGuNVh8tyzHqpUavxP9H1OesP84ffBqqhT++Y7VGllmu 5q19d8J7n3Zj1WZuDQWpwBP2m0dL7lc0c7eBSQY+1JX56nCLCCdUF+KwT+OidYq50NOcykRSCRR BlAt53FRc+G0RUFizKpv0L30X/+WSHiL0tpEFmZNWJSs0Q0v 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 --- drivers/perf/arm_dsu_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index 7ec4498e312f..bae3ca37f846 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -774,14 +774,12 @@ static int dsu_pmu_device_probe(struct platform_devic= e *pdev) return rc; } =20 -static int dsu_pmu_device_remove(struct platform_device *pdev) +static void dsu_pmu_device_remove(struct platform_device *pdev) { struct dsu_pmu *dsu_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&dsu_pmu->pmu); cpuhp_state_remove_instance(dsu_pmu_cpuhp_state, &dsu_pmu->cpuhp_node); - - return 0; } =20 static const struct of_device_id dsu_pmu_of_match[] =3D { @@ -806,7 +804,7 @@ static struct platform_driver dsu_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D dsu_pmu_device_probe, - .remove =3D dsu_pmu_device_remove, + .remove_new =3D dsu_pmu_device_remove, }; =20 static int dsu_pmu_cpu_online(unsigned int cpu, struct hlist_node *node) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 F156C2EB1A for ; Fri, 15 Dec 2023 13:59:35 +0000 (UTC) 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 1rE8iw-0002mJ-Tn; Fri, 15 Dec 2023 14:59:30 +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 1rE8iw-00G2Zl-Gk; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCY-7L; Fri, 15 Dec 2023 14:59:30 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/18] perf: arm_smmuv3: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:09 +0100 Message-ID: <23bfd1a73ce819ffce6137c237608684a3cdfda6.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1779; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=WoUmgvDx6FwJTMCVD5BbKw0j9xOmLxz1U/nwD6WKOcw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuvsCq62C9qwNvQCGzRX11jvZolyVoVwJoOU 2Pmd6ixFyyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbrwAKCRCPgPtYfRL+ Tko8B/4gczEX6cq/EpSayum0gjAC6YWceqcQyx+h3VFIm0jNwy1lr8d0iDJMRDqEeDZN0MEuCCh a+KRJiDm1t4J7zO8axMAreV6sCCMdL9vi8wLNJhphHuxDUaSu2CCmcKqkU7u/R4vXYf7D0qTAIM JhblkMgyhjTfzeqLNET/vGatSow+qjW5KWUVlH4cBNTVUWjk4t8nuxg5++dtTrUGnof6bo0Ivcn BPfniPiTdoBEE23U6vHSnp55tep/W0h9rqokLUZdRBE3F4r99Dvp8DqAKS5kQIuK+2E4dTadnFt Iv57KcGOAQZschzGKhWvvkv9JJigxUJemXGDPKAvp9NttgOz 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 --- drivers/perf/arm_smmuv3_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 6303b82566f9..af3ab3eb944e 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -965,14 +965,12 @@ static int smmu_pmu_probe(struct platform_device *pde= v) return err; } =20 -static int smmu_pmu_remove(struct platform_device *pdev) +static void smmu_pmu_remove(struct platform_device *pdev) { struct smmu_pmu *smmu_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&smmu_pmu->pmu); cpuhp_state_remove_instance_nocalls(cpuhp_state_num, &smmu_pmu->node); - - return 0; } =20 static void smmu_pmu_shutdown(struct platform_device *pdev) @@ -997,7 +995,7 @@ static struct platform_driver smmu_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D smmu_pmu_probe, - .remove =3D smmu_pmu_remove, + .remove_new =3D smmu_pmu_remove, .shutdown =3D smmu_pmu_shutdown, }; =20 --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 C65462FE3F for ; Fri, 15 Dec 2023 13:59:36 +0000 (UTC) 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 1rE8ix-0002mR-BL; Fri, 15 Dec 2023 14:59:31 +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 1rE8iw-00G2Zp-UK; Fri, 15 Dec 2023 14:59:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCc-Kk; Fri, 15 Dec 2023 14:59:30 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/18] perf: arm_spe: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:10 +0100 Message-ID: X-Mailer: git-send-email 2.42.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=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ebvrrVyODNmxG3JvaFcjW9M/wrd0jxp2bmDDzLkJNiU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuwX1T9I98FsOZp/j5NoPrWESK2E3mBg3LWt VCaiOeyYiqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbsAAKCRCPgPtYfRL+ TgtzCACm2pQyhNJ/AJgC3ETsfXRz6oWzGYTxy2234b+nUURm2k4Z5MDNXqpcVrKfleWHD6qZnOP lQLYvUeaUjudGxEGvwadRqepqSeaV54gsAtNQhtSobFMoeJ4pXVxaDuB0N1krBYmqz87ykPvhxg NVqhwz+ZHZJTAmINKAd5gDhNRqratyN9uTiOTDF/dXuD304nabaTRih3ZSycOPQH8oT6eVkq7DQ XocFHOJ7jvs3CK0yv9kp3hQDqezmVM9YpymgUM4OLmi1WFxkVHEAELS8JsKIZQcWRuW8e65zfp/ DgW8qqlGV1xUqK5F6VpYEhF5nGCCmwNl6lwcGA6uO5FNQUwd 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 --- drivers/perf/arm_spe_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index b622d75d8c9e..35f0de03416f 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -1263,14 +1263,13 @@ static int arm_spe_pmu_device_probe(struct platform= _device *pdev) return ret; } =20 -static int arm_spe_pmu_device_remove(struct platform_device *pdev) +static void arm_spe_pmu_device_remove(struct platform_device *pdev) { struct arm_spe_pmu *spe_pmu =3D platform_get_drvdata(pdev); =20 arm_spe_pmu_perf_destroy(spe_pmu); arm_spe_pmu_dev_teardown(spe_pmu); free_percpu(spe_pmu->handle); - return 0; } =20 static struct platform_driver arm_spe_pmu_driver =3D { @@ -1281,7 +1280,7 @@ static struct platform_driver arm_spe_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D arm_spe_pmu_device_probe, - .remove =3D arm_spe_pmu_device_remove, + .remove_new =3D arm_spe_pmu_device_remove, }; =20 static int __init arm_spe_pmu_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 2EC4C31A73 for ; Fri, 15 Dec 2023 13:59:38 +0000 (UTC) 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 1rE8ix-0002mX-Ni; Fri, 15 Dec 2023 14:59:31 +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 1rE8ix-00G2Zt-9c; Fri, 15 Dec 2023 14:59:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iw-003cCg-Vu; Fri, 15 Dec 2023 14:59:31 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/18] perf: fsl_imx8_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:11 +0100 Message-ID: X-Mailer: git-send-email 2.42.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=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=T+20pqO282TURQ3KdX9THzy7jvQJXD3iKvoD14JC1QE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuxbrW2Q2PBwqQM4KAykWSBx75C886HAfiiG N9zzX46qnyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbsQAKCRCPgPtYfRL+ TqngCACUznhYhR8/BzUWG4hp303BWa3SfxSmsN5tbFkOpRb0acP7jKPKS4I7sOqxOeGneQWBCRy 5ZzIULjqO0zTyhnEn9S84dJL619cRTzQGlhi8D0nR33rRCL77eHWD7VIAgwubHYwpVpPX7lXOMS yAwjU2ryhwe7oezSSMrwBK1gv7W/2/wP6UlECKixF4SGK8Nl5xQlEYstnUkbV1pWQt7nit0bsGx dUBQJPvnCQIzi+U2WD5o1vix9RJSi8JTRUMZweWk9h5cMqdkla+cdKjN1rTw12munZhHlOZHVqb eZbhrpDVcuiFaV3nn2FLb6y/8q9hNNfQloQaA7pNifjITj90 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 --- drivers/perf/fsl_imx8_ddr_perf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_p= erf.c index 7dbfaee372c7..4e8fa5a48fcf 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -826,7 +826,7 @@ static int ddr_perf_probe(struct platform_device *pdev) return ret; } =20 -static int ddr_perf_remove(struct platform_device *pdev) +static void ddr_perf_remove(struct platform_device *pdev) { struct ddr_pmu *pmu =3D platform_get_drvdata(pdev); =20 @@ -836,7 +836,6 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); =20 ida_free(&ddr_ida, pmu->id); - return 0; } =20 static struct platform_driver imx_ddr_pmu_driver =3D { @@ -846,7 +845,7 @@ static struct platform_driver imx_ddr_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D ddr_perf_probe, - .remove =3D ddr_perf_remove, + .remove_new =3D ddr_perf_remove, }; =20 module_platform_driver(imx_ddr_pmu_driver); --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 8A41F321B2 for ; Fri, 15 Dec 2023 13:59:39 +0000 (UTC) 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 1rE8iy-0002mw-7C; Fri, 15 Dec 2023 14:59:32 +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 1rE8ix-00G2Zx-Oe; Fri, 15 Dec 2023 14:59:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8ix-003cCp-F9; Fri, 15 Dec 2023 14:59:31 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/18] perf: fsl_imx9_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:12 +0100 Message-ID: X-Mailer: git-send-email 2.42.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=1849; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=NXdhdQQKZ6b1dcEG52uoPa64FeprMMqzZeyISKSgu6o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFuzTqXZWOR+jvLxMzxn/N3EohQwIej9USNDY 81tT77OLbSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbswAKCRCPgPtYfRL+ TsMDCACbYsOrWMQZTfj5ByGoS2/B+xJSE88BfpXrdNEUrS5LY2vhmwYMlX1NbyFGP0DpYKUDqZC c7LDp1ZSXl2iLIjp9Thh3zsRes5DIjXq/tqCUwMIMyyh7JkHwZg5xcbjcsKrWiU/huql2AaryPH l51ZpPkIW6xq31eVovns+UQGQFnHKo1BTlZ8r7aGkuYjIn9J33uu1eTvqM1/e1mx1fxvHH5US6e sBKjLsP0K/dYgyOfYCQ5Jq2wb9e1yiLR9olQpEqjd6aAbHw1tCKWJcL+ZXWONA3ryjMdANvZdYk omhE20yAo7ThOBtHe0scaUjv2wgRUeQfMZMFK+c53Wyo0DDi 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 --- drivers/perf/fsl_imx9_ddr_perf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_p= erf.c index 9685645bfe04..72c2d3074cde 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -679,7 +679,7 @@ static int ddr_perf_probe(struct platform_device *pdev) return ret; } =20 -static int ddr_perf_remove(struct platform_device *pdev) +static void ddr_perf_remove(struct platform_device *pdev) { struct ddr_pmu *pmu =3D platform_get_drvdata(pdev); =20 @@ -689,8 +689,6 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); =20 ida_free(&ddr_ida, pmu->id); - - return 0; } =20 static struct platform_driver imx_ddr_pmu_driver =3D { @@ -700,7 +698,7 @@ static struct platform_driver imx_ddr_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D ddr_perf_probe, - .remove =3D ddr_perf_remove, + .remove_new =3D ddr_perf_remove, }; module_platform_driver(imx_ddr_pmu_driver); =20 --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 CD7F93C46A for ; Fri, 15 Dec 2023 13:59:45 +0000 (UTC) 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 1rE8iy-0002nD-JB; Fri, 15 Dec 2023 14:59:32 +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 1rE8iy-00G2a1-4C; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8ix-003cCt-RA; Fri, 15 Dec 2023 14:59:31 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Yicong Yang , Jonathan Cameron , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/18] perf: hisilicon: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:13 +0100 Message-ID: <33a8be0641b9447469fb7f6af0a10fb65efa97a3.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=7525; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=dBrvfcbHwf9YFBIy44YHlg/Q1c5X8IaEDYgph7Wakac=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtSa6C1fM6zVmn2PH2BmNO2Yyslosue3hvrUOZau1157d nzJyDzayWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBExC6x/1Ot6H8lPtlz4sYQ x0kF0uVPH34W3yM+R4OD48jU96XCd2S5GXdEli5YqqRbfsTsaOmjFlWVwpRfX5T25a17cD3G0UT DcvqU8+ye7w9teR60ptJYcMPUJNv+D18F5rW81ps3+2Ls5r7j62c2dMeJ2LIveHKVaV/2q6b9rQ d6Em15xVMDfTeKTA7mePG4wT/B9MAflycF3YtfCX713PTm3S6/rOifTMcOMR421jqa8J9TWfGwJ Hufr/2thFPv2O6Ernhev/hGZFaljRNTHsuVVZO6n8eK1N5WUVfx6pBtv250Q2RPznmmqBf3dDhm RwS68d9z0N5eNveQaaFxNR83V2qanchy6zqZ9pIqDZ2/AA== 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 these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K=C3=B6nig --- drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 5 ++--- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 5 ++--- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c b/drivers/perf/hi= silicon/hisi_uncore_cpa_pmu.c index 40f1bc9f9b91..0e923f94fa5b 100644 --- a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c @@ -341,7 +341,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *p= dev) return ret; } =20 -static int hisi_cpa_pmu_remove(struct platform_device *pdev) +static void hisi_cpa_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *cpa_pmu =3D platform_get_drvdata(pdev); =20 @@ -349,7 +349,6 @@ static int hisi_cpa_pmu_remove(struct platform_device *= pdev) cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_CPA_ONLINE, &cpa_pmu->node); hisi_cpa_pmu_enable_pm(cpa_pmu); - return 0; } =20 static struct platform_driver hisi_cpa_pmu_driver =3D { @@ -359,7 +358,7 @@ static struct platform_driver hisi_cpa_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_cpa_pmu_probe, - .remove =3D hisi_cpa_pmu_remove, + .remove_new =3D hisi_cpa_pmu_remove, }; =20 static int __init hisi_cpa_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/h= isilicon/hisi_uncore_ddrc_pmu.c index ffb039d05d07..b804e3738113 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -531,14 +531,13 @@ static int hisi_ddrc_pmu_probe(struct platform_device= *pdev) return ret; } =20 -static int hisi_ddrc_pmu_remove(struct platform_device *pdev) +static void hisi_ddrc_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *ddrc_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&ddrc_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE, &ddrc_pmu->node); - return 0; } =20 static struct platform_driver hisi_ddrc_pmu_driver =3D { @@ -548,7 +547,7 @@ static struct platform_driver hisi_ddrc_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_ddrc_pmu_probe, - .remove =3D hisi_ddrc_pmu_remove, + .remove_new =3D hisi_ddrc_pmu_remove, }; =20 static int __init hisi_ddrc_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hi= silicon/hisi_uncore_hha_pmu.c index 15caf99e1eef..21e69b1cdd4d 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -534,14 +534,13 @@ static int hisi_hha_pmu_probe(struct platform_device = *pdev) return ret; } =20 -static int hisi_hha_pmu_remove(struct platform_device *pdev) +static void hisi_hha_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *hha_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&hha_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE, &hha_pmu->node); - return 0; } =20 static struct platform_driver hisi_hha_pmu_driver =3D { @@ -551,7 +550,7 @@ static struct platform_driver hisi_hha_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_hha_pmu_probe, - .remove =3D hisi_hha_pmu_remove, + .remove_new =3D hisi_hha_pmu_remove, }; =20 static int __init hisi_hha_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hi= silicon/hisi_uncore_l3c_pmu.c index 794dbcd19b7a..51ba76871097 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -568,14 +568,13 @@ static int hisi_l3c_pmu_probe(struct platform_device = *pdev) return ret; } =20 -static int hisi_l3c_pmu_remove(struct platform_device *pdev) +static void hisi_l3c_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *l3c_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&l3c_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_L3_ONLINE, &l3c_pmu->node); - return 0; } =20 static struct platform_driver hisi_l3c_pmu_driver =3D { @@ -585,7 +584,7 @@ static struct platform_driver hisi_l3c_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_l3c_pmu_probe, - .remove =3D hisi_l3c_pmu_remove, + .remove_new =3D hisi_l3c_pmu_remove, }; =20 static int __init hisi_l3c_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/his= ilicon/hisi_uncore_pa_pmu.c index 797cf201996a..3cdb35c741f9 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -514,14 +514,13 @@ static int hisi_pa_pmu_probe(struct platform_device *= pdev) return ret; } =20 -static int hisi_pa_pmu_remove(struct platform_device *pdev) +static void hisi_pa_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *pa_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&pa_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_PA_ONLINE, &pa_pmu->node); - return 0; } =20 static const struct acpi_device_id hisi_pa_pmu_acpi_match[] =3D { @@ -539,7 +538,7 @@ static struct platform_driver hisi_pa_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_pa_pmu_probe, - .remove =3D hisi_pa_pmu_remove, + .remove_new =3D hisi_pa_pmu_remove, }; =20 static int __init hisi_pa_pmu_module_init(void) diff --git a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c b/drivers/perf/h= isilicon/hisi_uncore_sllc_pmu.c index e706ca567676..765bbd61db26 100644 --- a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c @@ -460,14 +460,13 @@ static int hisi_sllc_pmu_probe(struct platform_device= *pdev) return ret; } =20 -static int hisi_sllc_pmu_remove(struct platform_device *pdev) +static void hisi_sllc_pmu_remove(struct platform_device *pdev) { struct hisi_pmu *sllc_pmu =3D platform_get_drvdata(pdev); =20 perf_pmu_unregister(&sllc_pmu->pmu); cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE, &sllc_pmu->node); - return 0; } =20 static struct platform_driver hisi_sllc_pmu_driver =3D { @@ -477,7 +476,7 @@ static struct platform_driver hisi_sllc_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D hisi_sllc_pmu_probe, - .remove =3D hisi_sllc_pmu_remove, + .remove_new =3D hisi_sllc_pmu_remove, }; =20 static int __init hisi_sllc_pmu_module_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 C046530CE1 for ; Fri, 15 Dec 2023 13:59:37 +0000 (UTC) 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 1rE8iy-0002oE-Ra; Fri, 15 Dec 2023 14:59:32 +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 1rE8iy-00G2a5-Ek; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iy-003cCx-5M; Fri, 15 Dec 2023 14:59:32 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/18] perf: marvell_cn10k_ddr: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:14 +0100 Message-ID: <79f48409f663f0184f03d34c6a86359ea3aa1291.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1858; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=AaJsT1X2pzgRo5v0ti8PFad+Bo0hVSMW+Zt7jtXU/Pk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu1xixSuGrOf/p7nomBMD+boDsgfkZhsVcIJ jL3+jPNtqCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtQAKCRCPgPtYfRL+ Tiz6CACiS8xI0T+UYaD8IbsJWOu3Q5lL06rvqmuD1aiANRTc47wrYBNjHzsDwxz+vHj1i+MMOEW 9ESDSKrfsHg0U1507xoqY78JQV5B1qqgi9fN5GakPQx0XEjGhp/gwAXVDhAqcgsolhYY/LDq9IH jnk2bo35mJIH8passLkJkwKfrTyoOmpHWXVSvjgbl9r7DPfXfecidXcuDa6eUqiqe/yod94NmXZ +01OKeN6aoH0bTx14tOxYYr9rSYqd91XFO90LbvrppP/ZD6Qni7boOJZknVUpisulpSUufGxcRI cF7WmDCUCTzG8WzsG6a66pdtWVWV+J80XZAl/v9EedzAr14n 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 --- drivers/perf/marvell_cn10k_ddr_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/marvell_cn10k_ddr_pmu.c b/drivers/perf/marvell_cn= 10k_ddr_pmu.c index 524ba82bfce2..e2abca188dbe 100644 --- a/drivers/perf/marvell_cn10k_ddr_pmu.c +++ b/drivers/perf/marvell_cn10k_ddr_pmu.c @@ -697,7 +697,7 @@ static int cn10k_ddr_perf_probe(struct platform_device = *pdev) return ret; } =20 -static int cn10k_ddr_perf_remove(struct platform_device *pdev) +static void cn10k_ddr_perf_remove(struct platform_device *pdev) { struct cn10k_ddr_pmu *ddr_pmu =3D platform_get_drvdata(pdev); =20 @@ -706,7 +706,6 @@ static int cn10k_ddr_perf_remove(struct platform_device= *pdev) &ddr_pmu->node); =20 perf_pmu_unregister(&ddr_pmu->pmu); - return 0; } =20 #ifdef CONFIG_OF @@ -733,7 +732,7 @@ static struct platform_driver cn10k_ddr_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D cn10k_ddr_perf_probe, - .remove =3D cn10k_ddr_perf_remove, + .remove_new =3D cn10k_ddr_perf_remove, }; =20 static int __init cn10k_ddr_pmu_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 DC32130CFA for ; Fri, 15 Dec 2023 13:59:37 +0000 (UTC) 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 1rE8iz-0002pb-9k; Fri, 15 Dec 2023 14:59:33 +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 1rE8iy-00G2aA-R8; Fri, 15 Dec 2023 14:59:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iy-003cD1-Hr; Fri, 15 Dec 2023 14:59:32 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/18] perf: marvell_cn10k_tad: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:15 +0100 Message-ID: <055656e474208b0fb583e249530fa211fa3be57c.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1823; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=I1t5aJb11RWvKIbnkVtIejhEjKmdBG1m6FZj4F8ZzMY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu2lEYp/dB1CWftEjB+6ZuPTaGjyNucTK5gu xt4aJPN/KOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtgAKCRCPgPtYfRL+ TuDdB/kBymw7MNfXHM14jMTwT9lo4YG/rKEingqeCW6Fo0lo6/bvV3CO0nPSK2ER6RKINJQ1Br/ Fqk/85IWBL/L+MJNehclZ9NelvYivNs03ii3VXli7l/4gGJC9De3FGL6hOyAAEl9VGDJg38l9U8 LUEL0JuVui6u5eYK96P+kSHlr6N9jaajO1A4A3TEM2RwkFbyouqCMCMGxOs+UmD8o1gR8GxpBaE XKeeICZ0eW3hqicJKgJSTULFpSPR4xal0MI/wX6VwCcrtXtqL9nLWyGNlM9kKHV9FMgIqMkXA2N eSh5kMww8MrmaEbCsE8bouGhT7atXwxJAJtUPBjYlqN7n8vR 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 --- drivers/perf/marvell_cn10k_tad_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn= 10k_tad_pmu.c index fec8e82edb95..9e635f355470 100644 --- a/drivers/perf/marvell_cn10k_tad_pmu.c +++ b/drivers/perf/marvell_cn10k_tad_pmu.c @@ -351,15 +351,13 @@ static int tad_pmu_probe(struct platform_device *pdev) return ret; } =20 -static int tad_pmu_remove(struct platform_device *pdev) +static void tad_pmu_remove(struct platform_device *pdev) { struct tad_pmu *pmu =3D platform_get_drvdata(pdev); =20 cpuhp_state_remove_instance_nocalls(tad_pmu_cpuhp_state, &pmu->node); perf_pmu_unregister(&pmu->pmu); - - return 0; } =20 #ifdef CONFIG_OF @@ -385,7 +383,7 @@ static struct platform_driver tad_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D tad_pmu_probe, - .remove =3D tad_pmu_remove, + .remove_new =3D tad_pmu_remove, }; =20 static int tad_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 C285039FF1 for ; Fri, 15 Dec 2023 13:59:43 +0000 (UTC) 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 1rE8iz-0002qG-KU; Fri, 15 Dec 2023 14:59:33 +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 1rE8iz-00G2aE-5u; Fri, 15 Dec 2023 14:59:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iy-003cD5-SO; Fri, 15 Dec 2023 14:59:32 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/18] perf: qcom_l2: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:16 +0100 Message-ID: X-Mailer: git-send-email 2.42.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=1931; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=VICxICa9rzVcpxd4YQzS3q7MnqlVMsOIGitfxpEhihs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu3p7ogtYGPBuZCsFnYFvOZg9wLXH6J7bohW JxjI9JrbLSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbtwAKCRCPgPtYfRL+ ThOdB/4mmPoWmDYG5uyMcSwzK1WP92WjeDvUiQQBHkp31CnYoCZDmYf3AJ1RZgzA71ftT89NP2i J+cLLxvsIKrjQ3U3i0G19YYMR1Tglb6sueG4oEkAqW70R7o6o2/itPnTZ9Q2R+Wq8Q7ekDdxYxq BlW1X0FE2Izyor49KMINVvrLnQCBfeKqsVBvnYBuOjX2muGy9hthfxsi0aSuNDLaXcGFwf20U8i OKcHR08eDXQNS1ZDJIe9ol6PJaN9B5cQIq+nwg8Ao6rAHqjRzJjvUVKUZs8U652FRvkQUIs1vy+ I9Z5fboAp0nA9MFJcfavCbIjfX49SP1CiF6xwTbJN6LALack 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 Reviewed-by: Konrad Dybcio --- drivers/perf/qcom_l2_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index 3f9a98c17a89..148df5ae8ef8 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -965,7 +965,7 @@ static int l2_cache_pmu_probe(struct platform_device *p= dev) return err; } =20 -static int l2_cache_pmu_remove(struct platform_device *pdev) +static void l2_cache_pmu_remove(struct platform_device *pdev) { struct l2cache_pmu *l2cache_pmu =3D to_l2cache_pmu(platform_get_drvdata(pdev)); @@ -973,7 +973,6 @@ static int l2_cache_pmu_remove(struct platform_device *= pdev) perf_pmu_unregister(&l2cache_pmu->pmu); cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE, &l2cache_pmu->node); - return 0; } =20 static struct platform_driver l2_cache_pmu_driver =3D { @@ -983,7 +982,7 @@ static struct platform_driver l2_cache_pmu_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D l2_cache_pmu_probe, - .remove =3D l2_cache_pmu_remove, + .remove_new =3D l2_cache_pmu_remove, }; =20 static int __init register_l2_cache_pmu_driver(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 1E0FA31A6B for ; Fri, 15 Dec 2023 13:59:39 +0000 (UTC) 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 1rE8iz-0002qw-Ub; Fri, 15 Dec 2023 14:59:33 +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 1rE8iz-00G2aI-Gx; Fri, 15 Dec 2023 14:59:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iz-003cD9-6r; Fri, 15 Dec 2023 14:59:33 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/18] perf: thunderx2: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:17 +0100 Message-ID: <7be677dfa13d3a7eab6eef0d808ba8a9855d14ae.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=kNhz4owPoQxf/kqUCq0mPTfNfI890r9XsLm626uuoYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu4yiKFxvFEDp7JBUolIF9D0qBewRZ/dqBFl N4dGfN9J02JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbuAAKCRCPgPtYfRL+ TjaVB/wJVTyeqszuwR2rKLeyZ3db/apOK5yre94HQmLHVYCicO6VGSUcOl3xfZpe+DKWfaYvLCw 61Gc9lVkghr+qS2zMAqbfMp3vsZtTjIQcHVec7gfyFElV6Vtjwa37+KFimzRjZ7x3/OBzjFc9VH Jjv/kmaoskI+QTs+nOI8n2y9K4eA6buyPZtFlVprsNb5FtgZAjlM34qbZ8UuDBtuJhwQe9WQ1a3 Mbt6pPyJ3AC1zFWG4gzrCRAF0XsBSslW7lQXJR4guhyRPUYQFVQqYIlLx37pUu239v1MPzDB+xu hxYC8OSd3h603cGm3l2hnC+rjDDhJCXlXy4qP9Skhb6Vp7HM 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 --- drivers/perf/thunderx2_pmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c index 1edb9c03704f..e16d10c763de 100644 --- a/drivers/perf/thunderx2_pmu.c +++ b/drivers/perf/thunderx2_pmu.c @@ -993,7 +993,7 @@ static int tx2_uncore_probe(struct platform_device *pde= v) return 0; } =20 -static int tx2_uncore_remove(struct platform_device *pdev) +static void tx2_uncore_remove(struct platform_device *pdev) { struct tx2_uncore_pmu *tx2_pmu, *temp; struct device *dev =3D &pdev->dev; @@ -1009,7 +1009,6 @@ static int tx2_uncore_remove(struct platform_device *= pdev) } } } - return 0; } =20 static struct platform_driver tx2_uncore_driver =3D { @@ -1019,7 +1018,7 @@ static struct platform_driver tx2_uncore_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D tx2_uncore_probe, - .remove =3D tx2_uncore_remove, + .remove_new =3D tx2_uncore_remove, }; =20 static int __init tx2_uncore_driver_init(void) --=20 2.42.0 From nobody Sat Dec 27 20:56:20 2025 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 874C8347CB for ; Fri, 15 Dec 2023 13:59:40 +0000 (UTC) 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 1rE8j0-0002rC-Ed; Fri, 15 Dec 2023 14:59:34 +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 1rE8j0-00G2aM-0W; Fri, 15 Dec 2023 14:59:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE8iz-003cDE-Md; Fri, 15 Dec 2023 14:59:33 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Will Deacon , Mark Rutland Cc: Khuong Dinh , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/18] perf: xgene: Convert to platform remove callback returning void Date: Fri, 15 Dec 2023 14:59:18 +0100 Message-ID: <75dda01b2ad6e17f726830094bd38cb8faab5cbe.1702648125.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.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=1815; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=1D3m60kbnUksK/WuWQHSRAl7TZysqOiH8RstEIIaHz8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfFu6lmqjVGVsA8r8JJiVanp1hayMpcamEY8We UV3o/A1jOSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXxbugAKCRCPgPtYfRL+ ToLzB/9+s5OjzXe6GfBT4NB0Anrnt5XQvyWxHodZTkqso/txn8S20jxyKZBgbZEm40n6bByfE9Z Y5jY7X9eMilOhnD61sfIzpIOBqWx6Z/SLI1WMWtd511mmdFDYmIBfDfIaApfpdfHmnZo+rQG6mt UX9FuzjlqJzZzX0MXek0fZNGli/bUd9tryph6bZXAfcH823yujJWnWMTdYsBVOleq76Le5kEMFx 0mhhu7w2A+Hb4nKFzzdjyJEm3zhVdqhXpvu9f2Za2x4j9Ux4pNnzcC9QKwUrc7tlX77YTu4akFy CViUrNEh4DxQWjE4KTbRzMb+iGxv5nVA7/nsi4N1BMPw4JIF 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 --- drivers/perf/xgene_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index 7ce344248dda..0d49343d704b 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c @@ -1937,7 +1937,7 @@ xgene_pmu_dev_cleanup(struct xgene_pmu *xgene_pmu, st= ruct list_head *pmus) } } =20 -static int xgene_pmu_remove(struct platform_device *pdev) +static void xgene_pmu_remove(struct platform_device *pdev) { struct xgene_pmu *xgene_pmu =3D dev_get_drvdata(&pdev->dev); =20 @@ -1947,13 +1947,11 @@ static int xgene_pmu_remove(struct platform_device = *pdev) xgene_pmu_dev_cleanup(xgene_pmu, &xgene_pmu->mcpmus); cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE, &xgene_pmu->node); - - return 0; } =20 static struct platform_driver xgene_pmu_driver =3D { .probe =3D xgene_pmu_probe, - .remove =3D xgene_pmu_remove, + .remove_new =3D xgene_pmu_remove, .driver =3D { .name =3D "xgene-pmu", .of_match_table =3D xgene_pmu_of_match, --=20 2.42.0