From nobody Fri Sep 20 06:30:22 2024 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 55CD246437 for ; Wed, 27 Dec 2023 16:26:52 +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 1rIWjz-00059m-UU; Wed, 27 Dec 2023 17:26:43 +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 1rIWjw-001tZK-Lv; Wed, 27 Dec 2023 17:26:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjx-001Wmg-2E; Wed, 27 Dec 2023 17:26:41 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Sudeep Holla Cc: kernel@pengutronix.de, Cristian Marussi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] firmware: arm_scmi: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:25 +0100 Message-ID: <86165c8ccd0bb47000a29e711102795b36c8df41.1703693980.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=1796; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=JK/CSDYjlDzz8/Ko2zYkIZLw829LGnskJHP4zrb3nSc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFAzHGKIj+U2X2/VquNqcN62INqnmVrFKeBUV waVRlMvMSiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQMwAKCRCPgPtYfRL+ To+6CACSdd6ebXHEHuZH278GDpN/34UYlQyumgf05hEYLn7eStz0mwZTNZNBViswZLobbkbPjvj TUoGFM03/AvIKHgJVHzZmivM8csSsF18pCdURQ/26QNnv4XEItA9q6KOOGze54yeGKt4ir7mRwo H1syPHLrzQLDrf00QPIvhRj3sJoRF6FHV8HfYI7nGpnextDyr6+zTkcfxOC1vUvY+TIUXgHMk3A J41YL+ZRdcpMZEH7qFNq9icFrtCTVzqpNTLBT7x0xMmtWYCvS6o5xqwpQLeDOadis6WNhBrmRIR jH3lsv1OVKlzE+oq89AayWxMuMsgh1FqBuumXnYiubyQyRqf 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/firmware/arm_scmi/driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi= /driver.c index a9f70e6e58ac..3ea64b22cf0d 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2834,7 +2834,7 @@ static int scmi_probe(struct platform_device *pdev) return ret; } =20 -static int scmi_remove(struct platform_device *pdev) +static void scmi_remove(struct platform_device *pdev) { int id; struct scmi_info *info =3D platform_get_drvdata(pdev); @@ -2868,8 +2868,6 @@ static int scmi_remove(struct platform_device *pdev) scmi_cleanup_txrx_channels(info); =20 ida_free(&scmi_id, info->id); - - return 0; } =20 static ssize_t protocol_version_show(struct device *dev, @@ -2947,7 +2945,7 @@ static struct platform_driver scmi_driver =3D { .dev_groups =3D versions_groups, }, .probe =3D scmi_probe, - .remove =3D scmi_remove, + .remove_new =3D scmi_remove, }; =20 /** --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 55D024643A for ; Wed, 27 Dec 2023 16:26:52 +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 1rIWjz-00059n-UU; Wed, 27 Dec 2023 17:26:43 +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 1rIWjw-001tZN-S1; Wed, 27 Dec 2023 17:26:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjx-001Wml-2q; Wed, 27 Dec 2023 17:26:41 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Sudeep Holla Cc: kernel@pengutronix.de, Cristian Marussi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/11] firmware: arm_scpi: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:26 +0100 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=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=FF/nyDTSJyTf9/tBea2/MLsCLR8e7FBGnIR1tjwpPwI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtSeABNWkSWxW+K3Zy7f/dCWS2W3brhfZqL89Gt5ajz3n 5/l2prWyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEHnGz/48sWTf7KcOmybfe 6BUIBmfaXZRuiGbcW2vINcnP0l/77oLDb7z+TfNinhh9aNmrp32nlbf9CS1b9eLnjSLtPh8jq6K pW+LaUxP5XGsnOU9eumqKqafE/PQnXK7ZmfvmBFapsng1TrmyoCdjDfuziWci8u+uLjzX4PwqsV wnQ85VxDLp5Y76eSvOezcF5ifFVPF1ap7pqJu0+pLRhy0Rx28rK2fJWk6o/v1y1iLuO9XcChqfT px/lipww4XdyNNbwadtHtvdEmmPnVL39vK0WKUlWCVWlK18tq0j+cUcnqCTKY1WtrO+3mFt4yyW iu0PVPBe9DBh39LfF8NqRdtUuDUXTluk2cBntu/aDtlbAA== 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/firmware/arm_scpi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index 3f123f592cb4..94a6b4e667de 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -863,7 +863,7 @@ static void scpi_free_channels(void *data) mbox_free_channel(info->channels[i].chan); } =20 -static int scpi_remove(struct platform_device *pdev) +static void scpi_remove(struct platform_device *pdev) { int i; struct scpi_drvinfo *info =3D platform_get_drvdata(pdev); @@ -874,8 +874,6 @@ static int scpi_remove(struct platform_device *pdev) kfree(info->dvfs[i]->opps); kfree(info->dvfs[i]); } - - return 0; } =20 #define MAX_SCPI_XFERS 10 @@ -1048,7 +1046,7 @@ static struct platform_driver scpi_driver =3D { .dev_groups =3D versions_groups, }, .probe =3D scpi_probe, - .remove =3D scpi_remove, + .remove_new =3D scpi_remove, }; module_platform_driver(scpi_driver); =20 --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 62F954777B for ; Wed, 27 Dec 2023 16:26:56 +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 1rIWjz-00059o-7m; Wed, 27 Dec 2023 17:26:43 +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 1rIWjx-001tZQ-34; Wed, 27 Dec 2023 17:26:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjy-001Wmp-0L; Wed, 27 Dec 2023 17:26:42 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Tzung-Bi Shih Cc: kernel@pengutronix.de, Brian Norris , Julius Werner , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 03/11] firmware: coreboot_table: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:27 +0100 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=1801; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=KkJyKFS1tf/Q7uVpfdVoCv0nkB+vzLTFnmTd3unQUCU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA137qRFmgFH2CW2v85lYu8zAPejn58AHqK2 y66+PpOHTKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQNQAKCRCPgPtYfRL+ TqVtB/48BvW7i2SaSdpDvOEONys5ylT5SBQ0NFtzPMFYUto6wdGN1kkOlGP/CeHhN4+hi0wKzpY aei8fq67PrCMzLM+Z/QsZ95Su0qZnirumRVS5R1ub5V1tt/vzKZMiYDbsz0UAMg6tL4XgGTBhDV urNBX6t1EoZ0Ged/KE/7W1wI2GElYzzIgZ7ZEs6ecrhEH27d0gNxIfePA+hbyIL1P0gY7Xpe0GB GOVrnpTqwE7HXXXOQKWoZUbhrsd24TQYUx1D1aOf/BNFPd1LrPRYIe+NGAby2749jgXqPrx34jN BRHOGnBtxPJntg/feNHo2HmP9cjZInR7u39XBs5Y14wZs0EM 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/firmware/google/coreboot_table.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/go= ogle/coreboot_table.c index 33ae94745aef..2a4469bf1b81 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -176,10 +176,9 @@ static int __cb_dev_unregister(struct device *dev, voi= d *dummy) return 0; } =20 -static int coreboot_table_remove(struct platform_device *pdev) +static void coreboot_table_remove(struct platform_device *pdev) { bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister); - return 0; } =20 #ifdef CONFIG_ACPI @@ -201,7 +200,7 @@ MODULE_DEVICE_TABLE(of, coreboot_of_match); =20 static struct platform_driver coreboot_table_driver =3D { .probe =3D coreboot_table_probe, - .remove =3D coreboot_table_remove, + .remove_new =3D coreboot_table_remove, .driver =3D { .name =3D "coreboot_table", .acpi_match_table =3D ACPI_PTR(cros_coreboot_acpi_match), --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 BFD4848CDB for ; Wed, 27 Dec 2023 16:27:02 +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 1rIWk9-00059p-P6; Wed, 27 Dec 2023 17:26:53 +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 1rIWjx-001tZT-E1; Wed, 27 Dec 2023 17:26:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjy-001Wmt-1O; Wed, 27 Dec 2023 17:26:42 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Shawn Guo , Sascha Hauer , Daniel Baluta , Thierry Reding , Sudeep Holla , Hao Ge , Rob Herring , Christophe JAILLET Cc: kernel@pengutronix.de, Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/11] firmware: imx-dsp: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:28 +0100 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=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=MlqBx3QsOKLYhj8m2E2EGfokVOl5XV7UkQvCbxh8Dg8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA2JBjZjJ80khzwObhQcArQ5cwJEx64zJY36 CtxgF7WSbyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQNgAKCRCPgPtYfRL+ TgByB/4kZis+maU+iwmZbE6Rj8EHJS/0bW1FPBZc3bFsDVcvmuiiduDOw8HVY6Kgtd8olF/jklr 6e9JAlfeFGPqi/HNkDXO/x9MCxCRjZHCuLL6Yo/9b481c7rDhEb4Z+n5je2qNU8zg32CqxA3jD/ PyMHg0Jh8UZuCTwsvgjzWG+Wuxy5trk2jF2zNQVlX1AGixbNOM7nGCCp6al65O2s0YOgY6ohRj2 tJ/IS4IYapHTbktUPR4bQ2a1/w8MhOOdkgrDxdchBkauQgNtbqT9gcb+Xp2Ec8ltF8pM6DnycHt /ySIHanZz7kGgxGI/agQ1ot69EXC5J/A09VnL8E8rtstvwbS 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/firmware/imx/imx-dsp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c index a48a58e0c61f..01c8ef14eaec 100644 --- a/drivers/firmware/imx/imx-dsp.c +++ b/drivers/firmware/imx/imx-dsp.c @@ -160,7 +160,7 @@ static int imx_dsp_probe(struct platform_device *pdev) return 0; } =20 -static int imx_dsp_remove(struct platform_device *pdev) +static void imx_dsp_remove(struct platform_device *pdev) { struct imx_dsp_chan *dsp_chan; struct imx_dsp_ipc *dsp_ipc; @@ -173,8 +173,6 @@ static int imx_dsp_remove(struct platform_device *pdev) mbox_free_channel(dsp_chan->ch); kfree(dsp_chan->name); } - - return 0; } =20 static struct platform_driver imx_dsp_driver =3D { @@ -182,7 +180,7 @@ static struct platform_driver imx_dsp_driver =3D { .name =3D "imx-dsp", }, .probe =3D imx_dsp_probe, - .remove =3D imx_dsp_remove, + .remove_new =3D imx_dsp_remove, }; builtin_platform_driver(imx_dsp_driver); =20 --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 CE9E146424 for ; Wed, 27 Dec 2023 16:26:54 +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 1rIWjz-00059q-UX; Wed, 27 Dec 2023 17:26:43 +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 1rIWjx-001tZW-KD; Wed, 27 Dec 2023 17:26:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjy-001Wmx-21; Wed, 27 Dec 2023 17:26:42 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Matthias Brugger , AngeloGioacchino Del Regno , Thierry Reding , Rob Herring , Arnd Bergmann , Sudeep Holla Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 05/11] firmware: mtk-adsp-ipc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:29 +0100 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=1902; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=a63jCU/xmx3JjQAul7+0HQjMC2XzUPEGHuetp5aEk3E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA3VZRLFHuI4OPARK9PwC54oddug682gpz+A znDmlUhrkyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQNwAKCRCPgPtYfRL+ ThSDCACWPSchgdcXQcSe1ovZmVZAWx9vNPIVAPhqu3ln3Y0yG+zsXGBC0H7gc9JaRmGlwAY+riC eSc7+8e3umCnEsXjDUEu6wJnGrWaJCNz4XQlWNzvPaZFSY+i7Mu4Ez+p6/+vcyu1KcXoXqvMFO5 67QAssIT+LYqZ/834Rieou/m7tWmsf3nBZavxgKHIqdkP+pH9gqxcaNnaFixFR89MkOfLUJ9aZH l9qeyQnZP819ihTK0OlbOu2YRAc0oB14rJ36x3WDkg+YwHzMTsBiMMubWPbCdQzfoeX27D4TvnG VKoMdv3Bb+9ECeJu3WAOA//PoFDN6f9c40u6nLxdDcFKxoD0 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/firmware/mtk-adsp-ipc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/mtk-adsp-ipc.c b/drivers/firmware/mtk-adsp-ip= c.c index 85e94ddc7204..a762302978de 100644 --- a/drivers/firmware/mtk-adsp-ipc.c +++ b/drivers/firmware/mtk-adsp-ipc.c @@ -116,7 +116,7 @@ static int mtk_adsp_ipc_probe(struct platform_device *p= dev) return 0; } =20 -static int mtk_adsp_ipc_remove(struct platform_device *pdev) +static void mtk_adsp_ipc_remove(struct platform_device *pdev) { struct mtk_adsp_ipc *adsp_ipc =3D dev_get_drvdata(&pdev->dev); struct mtk_adsp_chan *adsp_chan; @@ -126,8 +126,6 @@ static int mtk_adsp_ipc_remove(struct platform_device *= pdev) adsp_chan =3D &adsp_ipc->chans[i]; mbox_free_channel(adsp_chan->ch); } - - return 0; } =20 static struct platform_driver mtk_adsp_ipc_driver =3D { @@ -135,7 +133,7 @@ static struct platform_driver mtk_adsp_ipc_driver =3D { .name =3D "mtk-adsp-ipc", }, .probe =3D mtk_adsp_ipc_probe, - .remove =3D mtk_adsp_ipc_remove, + .remove_new =3D mtk_adsp_ipc_remove, }; builtin_platform_driver(mtk_adsp_ipc_driver); =20 --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 D0A654643C for ; Wed, 27 Dec 2023 16:26:53 +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 1rIWk0-00059r-38; Wed, 27 Dec 2023 17:26:44 +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 1rIWjx-001tZZ-Qh; Wed, 27 Dec 2023 17:26:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjy-001Wn1-2g; Wed, 27 Dec 2023 17:26:42 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Gabriel Somlo , "Michael S. Tsirkin" Cc: kernel@pengutronix.de, qemu-devel@nongnu.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/11] firmware: qemu_fw_cfg: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:30 +0100 Message-ID: <8d7d86a24ea36985845c17b6da0933fedbf99ad8.1703693980.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=1964; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=Nuh2zfgdzxmPQm9xjM7Qd8aGlwMSzi2SytLozr/ldNI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA4SiZA8Czr5oUw4pC3X33baRdQ2zK8UNaGd qJkOIfRcM+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQOAAKCRCPgPtYfRL+ TiVtB/9jFGL9M1pmYrAxhcbUa8Fjt8yPqmgn+z7SvuziuDVEWqFHjFWJ8VQZBJ5zynq/yVPl1f6 urdnJg6eOFNj0PYq6BeEZ0EBhieCqObdsqUavigZblPpdxkoUx+3OknYd6j30HbZY3oT2XIJb7g z8LpDGjq3AtUsQvnbSDQnY2Yo/6iw96gEaXu2oAj6UECO8y+KSbYOOhmw320RX5KTlY0lrGlFl1 JHVQBU5OErrYaujF0lFh2gCB3ZMzwHWgidVCDjnKmdMZShf75AeOFCD20INk02WCoNgbKOxzM6S iYLX9UIsbnWxPSzM3Y6UDLK4MeGi4N/dEn96Fg/SHu+Ia7E2 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 Acked-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- drivers/firmware/qemu_fw_cfg.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 1448f61173b3..03da9a4354f8 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -731,7 +731,7 @@ static int fw_cfg_sysfs_probe(struct platform_device *p= dev) return err; } =20 -static int fw_cfg_sysfs_remove(struct platform_device *pdev) +static void fw_cfg_sysfs_remove(struct platform_device *pdev) { pr_debug("fw_cfg: unloading.\n"); fw_cfg_sysfs_cache_cleanup(); @@ -739,7 +739,6 @@ static int fw_cfg_sysfs_remove(struct platform_device *= pdev) fw_cfg_io_cleanup(); fw_cfg_kset_unregister_recursive(fw_cfg_fname_kset); fw_cfg_kobj_cleanup(fw_cfg_sel_ko); - return 0; } =20 static const struct of_device_id fw_cfg_sysfs_mmio_match[] =3D { @@ -758,7 +757,7 @@ MODULE_DEVICE_TABLE(acpi, fw_cfg_sysfs_acpi_match); =20 static struct platform_driver fw_cfg_sysfs_driver =3D { .probe =3D fw_cfg_sysfs_probe, - .remove =3D fw_cfg_sysfs_remove, + .remove_new =3D fw_cfg_sysfs_remove, .driver =3D { .name =3D "fw_cfg", .of_match_table =3D fw_cfg_sysfs_mmio_match, --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 9CF4D47F41 for ; Wed, 27 Dec 2023 16:26:56 +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 1rIWk0-00059y-0b; Wed, 27 Dec 2023 17:26:44 +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 1rIWjy-001tZc-14; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001Wn5-08; Wed, 27 Dec 2023 17:26:43 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Florian Fainelli , Kieran Bingham , Arnd Bergmann , Rob Herring Cc: kernel@pengutronix.de, Broadcom internal kernel review list , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/11] firmware: raspberrypi: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:31 +0100 Message-ID: <5df31ef3c069f45634631c9c639bbb60ab1d4798.1703693980.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=1900; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=8OnFnV9+Q+XjHGFocc6jyNJphVm9oGZbvop0yAJNf9o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA5eCGsDsplPuScmklfE3nyikx3e0+FJY3l8 BL3mj5KWsuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQOQAKCRCPgPtYfRL+ TrYJB/wKMxZ0dVeqePWzIe13JUFhLVI4QUjz0EFQb5Rn475cfqK+B7i3dx0wcVewGUkDahlovG2 tdfvhL//8Gt6HvqFq2H+aCEBbKA4BHa48gkArRdq6xQEZDt5z0rQld5osnTbW0IDOdPoYaNuxo5 mkLOex1INSKouwkConwu8R0j9KDoV2neCB/vd0WEhYl0KpkvNgNdCBWBvMxmtoqSGdvAjb9+zb7 qwYQ7p93oWEIF4p9nBNulGEjF14nU7UlVrhmDf7OSOreQ02WFGTaYPacVKdTH9dxk/m5za93xoD 3zuzyc/kgU28KdvmxsL8G2Y1/r2et4CQOAkdyHhWt/k34anG 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: Florian Fainelli --- drivers/firmware/raspberrypi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index 4cd290a60fba..322aada20f74 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c @@ -317,7 +317,7 @@ static void rpi_firmware_shutdown(struct platform_devic= e *pdev) rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_REBOOT, NULL, 0); } =20 -static int rpi_firmware_remove(struct platform_device *pdev) +static void rpi_firmware_remove(struct platform_device *pdev) { struct rpi_firmware *fw =3D platform_get_drvdata(pdev); =20 @@ -327,8 +327,6 @@ static int rpi_firmware_remove(struct platform_device *= pdev) rpi_clk =3D NULL; =20 rpi_firmware_put(fw); - - return 0; } =20 static const struct of_device_id rpi_firmware_of_match[] =3D { @@ -406,7 +404,7 @@ static struct platform_driver rpi_firmware_driver =3D { }, .probe =3D rpi_firmware_probe, .shutdown =3D rpi_firmware_shutdown, - .remove =3D rpi_firmware_remove, + .remove_new =3D rpi_firmware_remove, }; module_platform_driver(rpi_firmware_driver); =20 --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 F3FB346430 for ; Wed, 27 Dec 2023 16:26:51 +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 1rIWjz-0005A2-NZ; Wed, 27 Dec 2023 17:26:43 +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 1rIWjy-001tZf-7y; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001WnB-0q; Wed, 27 Dec 2023 17:26:43 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Dinh Nguyen Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 08/11] firmware: stratix10-rsu: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:32 +0100 Message-ID: <06df45c697a747cb6543800a4613db6e1f5462b4.1703693980.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=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=6lAFjA5yiszFloMYI5qzwPntohv2cozrx2dH/FwaD6s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA6uGEchezFuteKgpv7rVwlJjuBW7qQizAIb F8CKXZq1nSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQOgAKCRCPgPtYfRL+ TkKAB/wNqVOLInJA6P/jvSiLEyPTYDGW0rx8IlWU5cUStwjy0D3Rje8+JpchpcR5tb9pXUv9t1W ac2YENF8QcnS7ANBmdkC29mfmfyXZMrgdeTjG6lJZNR4Sz1QNDOL9s+pQAmZqS4CWWK+SmMNkEZ ojZkPxPMuIf7WJlS9b3IzQEOyGX1/ewLDgJHzEy2vyFsFMwt6bWP3uIjjluRq56SqTzw950nSuK X8uYMtNSdvir5kAH9fMIWCar4LGKQrBAbfl5t1zRKgFAdy21Fo/AGRIoNzj4Z8aCDaWLmxusYrT c/L/B7MzLUqe+JDZeQaRG1inrUTG9OVlRJGb4E+Zk2xq4lSJ 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 Acked-by: Dinh Nguyen --- drivers/firmware/stratix10-rsu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-= rsu.c index 4f7a7abada48..e20cee9c2d32 100644 --- a/drivers/firmware/stratix10-rsu.c +++ b/drivers/firmware/stratix10-rsu.c @@ -793,17 +793,16 @@ static int stratix10_rsu_probe(struct platform_device= *pdev) return ret; } =20 -static int stratix10_rsu_remove(struct platform_device *pdev) +static void stratix10_rsu_remove(struct platform_device *pdev) { struct stratix10_rsu_priv *priv =3D platform_get_drvdata(pdev); =20 stratix10_svc_free_channel(priv->chan); - return 0; } =20 static struct platform_driver stratix10_rsu_driver =3D { .probe =3D stratix10_rsu_probe, - .remove =3D stratix10_rsu_remove, + .remove_new =3D stratix10_rsu_remove, .driver =3D { .name =3D "stratix10-rsu", .dev_groups =3D rsu_groups, --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 F3F5746420 for ; Wed, 27 Dec 2023 16:26:51 +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 1rIWjz-0005A4-Te; Wed, 27 Dec 2023 17:26:43 +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 1rIWjy-001tZj-E6; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001WnF-1S; Wed, 27 Dec 2023 17:26:43 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Dinh Nguyen Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 09/11] firmware: stratix10-svc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:33 +0100 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=1913; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=+Yp1dgFMlCSzMuNAOCbuCl8YKa3LjfoSgbk3TSiz68M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA7vfChqYEofqwrz3YeDW1AnHg6WinguwSG1 /9J4dCFhhKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQOwAKCRCPgPtYfRL+ TuSRB/wO29Z+uGNK7yIFswymPxzBzPy/Z4n037X2YkjRXFiG9xxJbNe1VpNhCwd2OWIyxBs1+5M buXcL8F4FtbajrNFtUm42/UR/aUCI0d8gT2ISJVpzU39YarYpsYq3yXQMuR1Yqt4AUrBGsHq/BV aOhAV1+zQg4csv1YyVhO0ZmN1kWjShQd3uwz7cHmB2NPN4KD3X7OvhxMKx36Pgc3lC8kTN+bxJj Ex9RnteN/1b2ZAoA7D/sj9snV5GibE0Tw17FlC+BOKis6osHRUb+n7de+uqRnYGHVIvfyFCx3NX sOJ2To+9pfzDC3922sjuqSaf6t24I2I+DE8y0NLfubtAFO2A 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 Acked-by: Dinh Nguyen --- drivers/firmware/stratix10-svc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-= svc.c index c693da60e9a9..528f37417aea 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -1251,7 +1251,7 @@ static int stratix10_svc_drv_probe(struct platform_de= vice *pdev) return ret; } =20 -static int stratix10_svc_drv_remove(struct platform_device *pdev) +static void stratix10_svc_drv_remove(struct platform_device *pdev) { struct stratix10_svc *svc =3D dev_get_drvdata(&pdev->dev); struct stratix10_svc_controller *ctrl =3D platform_get_drvdata(pdev); @@ -1267,13 +1267,11 @@ static int stratix10_svc_drv_remove(struct platform= _device *pdev) if (ctrl->genpool) gen_pool_destroy(ctrl->genpool); list_del(&ctrl->node); - - return 0; } =20 static struct platform_driver stratix10_svc_driver =3D { .probe =3D stratix10_svc_drv_probe, - .remove =3D stratix10_svc_drv_remove, + .remove_new =3D stratix10_svc_drv_remove, .driver =3D { .name =3D "stratix10-svc", .of_match_table =3D stratix10_svc_drv_match, --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 F3FD246433 for ; Wed, 27 Dec 2023 16:26:51 +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 1rIWk0-0005AX-5U; Wed, 27 Dec 2023 17:26:44 +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 1rIWjy-001tZm-LQ; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001WnJ-29; Wed, 27 Dec 2023 17:26:43 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: =?utf-8?q?Marek_Beh=C3=BAn?= Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 10/11] firmware: turris-mox-rwtm: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:34 +0100 Message-ID: <9074d1ad2e889425991fecad664781ae27b2418a.1703693980.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=2006; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=WEZQXXd5yEntU2Gt+f7/Gkh5GXx5rKG3A+0Dnwst0LE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA9qk9zaKQX3LUk4LnI0Bgdn7cRxwonrs9nY Bwreka7G7iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQPQAKCRCPgPtYfRL+ TiYRCAChHvmLzvr6zrz7IyRAAX7lZidZ3ESfne2udN3JSW4mLtYdzEQ6YvEhfoWtA0osET5XGJj adYGI/CTr/MJDQAxQ+jkv+BRbPpEN6CCoJ2LuD9B7gL+tfWOhswYSx0i6QQVveeVOOKgo+kwksw gF6e5l1WR/p8iVc7sdSx7mYe6rrTRsgCr7Sk3cU4UrksOY7GZJNhq+4Scz7YrvYwl8qABoCE0c/ 9DeaGLUueTXrSSFQsWrC4IPZVIU+qxZSdAMGf8AAKvrrxwmj3IUwMPMrsXmQhWxkbM55Nz7TNYW dOKmgJ4t1gq2q54Qnwb9gC2QLgcW76fwYFL9l6/JeEvYOJof 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: Marek Beh=C3=BAn --- drivers/firmware/turris-mox-rwtm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-m= ox-rwtm.c index 2de0fb139ce1..31d962cdd6eb 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -554,7 +554,7 @@ static int turris_mox_rwtm_probe(struct platform_device= *pdev) return ret; } =20 -static int turris_mox_rwtm_remove(struct platform_device *pdev) +static void turris_mox_rwtm_remove(struct platform_device *pdev) { struct mox_rwtm *rwtm =3D platform_get_drvdata(pdev); =20 @@ -562,8 +562,6 @@ static int turris_mox_rwtm_remove(struct platform_devic= e *pdev) sysfs_remove_files(rwtm_to_kobj(rwtm), mox_rwtm_attrs); kobject_put(rwtm_to_kobj(rwtm)); mbox_free_channel(rwtm->mbox); - - return 0; } =20 static const struct of_device_id turris_mox_rwtm_match[] =3D { @@ -576,7 +574,7 @@ MODULE_DEVICE_TABLE(of, turris_mox_rwtm_match); =20 static struct platform_driver turris_mox_rwtm_driver =3D { .probe =3D turris_mox_rwtm_probe, - .remove =3D turris_mox_rwtm_remove, + .remove_new =3D turris_mox_rwtm_remove, .driver =3D { .name =3D DRIVER_NAME, .of_match_table =3D turris_mox_rwtm_match, --=20 2.43.0 From nobody Fri Sep 20 06:30:22 2024 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 D5AB448CD9 for ; Wed, 27 Dec 2023 16:27:01 +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 1rIWk0-0005Bf-PT; Wed, 27 Dec 2023 17:26:44 +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 1rIWjy-001tZq-Se; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001WnN-2r; Wed, 27 Dec 2023 17:26:43 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Michal Simek , Greg Kroah-Hartman , Jay Buddhabhatti , Sai Krishna Potthuri , Linus Walleij , Nava kishore Manne , Rajan Vaja , Rob Herring , Dhaval Shah , Marek Vasut Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/11] firmware: zynqmp: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:35 +0100 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=1949; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=5lA5AskgyOWj5RlJyQL/1YZMBAmaOueb91fZw7g7wBk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA+SOL/OLAdfMhQjjJrd6i8QwhOba6xFIvvF 9XxF7gr7VqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQPgAKCRCPgPtYfRL+ Tr/0B/43t00D3aB2EI/DNiEEuY+18Axew5V9CICgtxrn/vfQ8Yk5ViKo9PuE1Ee5VBjRwbh0bpP JYG7GNO2F7JcSXMEOEgxIs17hku48vv+Qabv4ho0F1TtgwWiOWxaX2n6yTt8FkbKXykKoV8nEW6 vSR53TvZNvtyIpP59/0KAIs7//PMmtpBfP37i+0JUmDvIH1ypp0rlDDZH+tP9Zjg5kwnv0QCtH/ YoBdzx7xDa5QfcjvFmYVuedqXmDX8n1ratrsNABJKYmaVbMnFIO9qWZiZVc7Xollxdmk9JFHXzi M1F+jOJ8BFTCXyiVfelpt9t0eIk7Gcb4yU+IDf4MHG7rR3+N 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: Michal Simek --- drivers/firmware/xilinx/zynqmp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zyn= qmp.c index a55dfd9bae6b..73cae6ef83ec 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1929,7 +1929,7 @@ static int zynqmp_firmware_probe(struct platform_devi= ce *pdev) return of_platform_populate(dev->of_node, NULL, NULL, dev); } =20 -static int zynqmp_firmware_remove(struct platform_device *pdev) +static void zynqmp_firmware_remove(struct platform_device *pdev) { struct pm_api_feature_data *feature_data; struct hlist_node *tmp; @@ -1944,8 +1944,6 @@ static int zynqmp_firmware_remove(struct platform_dev= ice *pdev) } =20 platform_device_unregister(em_dev); - - return 0; } =20 static const struct of_device_id zynqmp_firmware_of_match[] =3D { @@ -1962,6 +1960,6 @@ static struct platform_driver zynqmp_firmware_driver = =3D { .dev_groups =3D zynqmp_firmware_groups, }, .probe =3D zynqmp_firmware_probe, - .remove =3D zynqmp_firmware_remove, + .remove_new =3D zynqmp_firmware_remove, }; module_platform_driver(zynqmp_firmware_driver); --=20 2.43.0