From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 17/18] remoteproc: stm32: Convert to platform remove callback returning void Date: Thu, 4 May 2023 21:44:52 +0200 [thread overview] Message-ID: <20230504194453.1150368-18-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230504194453.1150368-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/remoteproc/stm32_rproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 8746cbb1f168..19716ec82aae 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -867,7 +867,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) return ret; } -static int stm32_rproc_remove(struct platform_device *pdev) +static void stm32_rproc_remove(struct platform_device *pdev) { struct rproc *rproc = platform_get_drvdata(pdev); struct stm32_rproc *ddata = rproc->priv; @@ -885,8 +885,6 @@ static int stm32_rproc_remove(struct platform_device *pdev) device_init_wakeup(dev, false); } rproc_free(rproc); - - return 0; } static int __maybe_unused stm32_rproc_suspend(struct device *dev) @@ -916,7 +914,7 @@ static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe, - .remove = stm32_rproc_remove, + .remove_new = stm32_rproc_remove, .driver = { .name = "stm32-rproc", .pm = &stm32_rproc_pm_ops, -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 17/18] remoteproc: stm32: Convert to platform remove callback returning void Date: Thu, 4 May 2023 21:44:52 +0200 [thread overview] Message-ID: <20230504194453.1150368-18-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230504194453.1150368-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/remoteproc/stm32_rproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 8746cbb1f168..19716ec82aae 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -867,7 +867,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) return ret; } -static int stm32_rproc_remove(struct platform_device *pdev) +static void stm32_rproc_remove(struct platform_device *pdev) { struct rproc *rproc = platform_get_drvdata(pdev); struct stm32_rproc *ddata = rproc->priv; @@ -885,8 +885,6 @@ static int stm32_rproc_remove(struct platform_device *pdev) device_init_wakeup(dev, false); } rproc_free(rproc); - - return 0; } static int __maybe_unused stm32_rproc_suspend(struct device *dev) @@ -916,7 +914,7 @@ static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe, - .remove = stm32_rproc_remove, + .remove_new = stm32_rproc_remove, .driver = { .name = "stm32-rproc", .pm = &stm32_rproc_pm_ops, -- 2.39.2
next prev parent reply other threads:[~2023-05-04 20:46 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-05-04 19:44 [PATCH 00/18] remoteproc: Convert to platform remove callback returning void Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 01/18] remoteproc: da8xx: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 02/18] remoteproc: imx_dsp: " Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-04 21:33 ` Iuliana Prodan 2023-05-04 21:33 ` Iuliana Prodan 2023-05-04 19:44 ` [PATCH 03/18] remoteproc: imx: " Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-04 21:34 ` Iuliana Prodan 2023-05-04 21:34 ` Iuliana Prodan 2023-05-04 19:44 ` [PATCH 04/18] remoteproc: keystone: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 05/18] remoteproc: meson_mx_ao_arc: " Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-08 19:39 ` Martin Blumenstingl 2023-05-08 19:39 ` Martin Blumenstingl 2023-05-04 19:44 ` [PATCH 06/18] remoteproc: mtk_scp: " Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-05 8:58 ` AngeloGioacchino Del Regno 2023-05-05 8:58 ` AngeloGioacchino Del Regno 2023-05-05 17:13 ` Matthias Brugger 2023-05-05 17:13 ` Matthias Brugger 2023-05-04 19:44 ` [PATCH 07/18] remoteproc: omap: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 08/18] remoteproc: pru: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 09/18] remoteproc: qcom_q6v5_adsp: " Uwe Kleine-König 2023-05-05 3:00 ` Caleb Connolly 2023-05-04 19:44 ` [PATCH 10/18] remoteproc: qcom_q6v5_mss: " Uwe Kleine-König 2023-05-05 3:00 ` Caleb Connolly 2023-05-04 19:44 ` [PATCH 11/18] remoteproc: qcom_q6v5_pas: " Uwe Kleine-König 2023-05-05 3:01 ` Caleb Connolly 2023-05-04 19:44 ` [PATCH 12/18] remoteproc: qcom_q6v5_wcss: " Uwe Kleine-König 2023-05-05 3:01 ` Caleb Connolly 2023-05-04 19:44 ` [PATCH 13/18] remoteproc: qcom_wcnss: " Uwe Kleine-König 2023-05-05 3:01 ` Caleb Connolly 2023-05-04 19:44 ` [PATCH 14/18] remoteproc: rcar: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 15/18] remoteproc: virtio: " Uwe Kleine-König 2023-05-04 19:44 ` [PATCH 16/18] remoteproc: st: " Uwe Kleine-König 2023-05-04 19:44 ` Uwe Kleine-König 2023-05-09 6:28 ` Patrice CHOTARD 2023-05-04 19:44 ` Uwe Kleine-König [this message] 2023-05-04 19:44 ` [PATCH 17/18] remoteproc: stm32: " Uwe Kleine-König 2023-05-09 17:11 ` Arnaud POULIQUEN 2023-05-04 19:44 ` [PATCH 18/18] remoteproc: wkup_m3: " Uwe Kleine-König 2023-05-09 20:09 ` [PATCH 00/18] remoteproc: " Mathieu Poirier 2023-05-09 20:09 ` Mathieu Poirier
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230504194453.1150368-18-u.kleine-koenig@pengutronix.de \ --to=u.kleine-koenig@pengutronix.de \ --cc=alexandre.torgue@foss.st.com \ --cc=andersson@kernel.org \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-remoteproc@vger.kernel.org \ --cc=linux-stm32@st-md-mailman.stormreply.com \ --cc=mathieu.poirier@linaro.org \ --cc=mcoquelin.stm32@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.