From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.com>,
Xu Yilun <yilun.xu@intel.com>
Cc: Tom Rix <trix@redhat.com>,
linux-fpga@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 01/13] fpga: altera-fpga2sdram: Convert to platform remove callback returning void
Date: Tue, 19 Dec 2023 18:31:59 +0100 [thread overview]
Message-ID: <017b9e17a0c88b2a633467633d304639e7765926.1703006638.git.u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <cover.1703006638.git.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 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önig <u.kleine-koenig@pengutronix.de>
---
drivers/fpga/altera-fpga2sdram.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/fpga/altera-fpga2sdram.c b/drivers/fpga/altera-fpga2sdram.c
index 1fa2ccc321ab..6b60ca004345 100644
--- a/drivers/fpga/altera-fpga2sdram.c
+++ b/drivers/fpga/altera-fpga2sdram.c
@@ -147,20 +147,18 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
return ret;
}
-static int alt_fpga_bridge_remove(struct platform_device *pdev)
+static void alt_fpga_bridge_remove(struct platform_device *pdev)
{
struct fpga_bridge *br = platform_get_drvdata(pdev);
fpga_bridge_unregister(br);
-
- return 0;
}
MODULE_DEVICE_TABLE(of, altera_fpga_of_match);
static struct platform_driver altera_fpga_driver = {
.probe = alt_fpga_bridge_probe,
- .remove = alt_fpga_bridge_remove,
+ .remove_new = alt_fpga_bridge_remove,
.driver = {
.name = "altera_fpga2sdram_bridge",
.of_match_table = of_match_ptr(altera_fpga_of_match),
--
2.42.0
next prev parent reply other threads:[~2023-12-19 17:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 17:31 [PATCH 00/13] fpga: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-19 17:31 ` Uwe Kleine-König [this message]
2023-12-19 17:32 ` [PATCH 02/13] fpga: altera-freeze-bridge: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 03/13] fpga: altera-hps2fpga: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 04/13] fpga: dfl-afu-main: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 05/13] fpga: dfl-fme-br: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 06/13] fpga: dfl-fme-main: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 07/13] fpga: dfl-fme-region: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 08/13] fpga: intel-m10-bmc-sec-update: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 09/13] fpga: of-fpga-region: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 10/13] fpga: socfpga-a10: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 11/13] fpga: stratix10-soc: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 12/13] fpga: xilinx-pr-decoupler: " Uwe Kleine-König
2023-12-19 17:32 ` [PATCH 13/13] fpga: zynq-fpga: " Uwe Kleine-König
2023-12-25 6:01 ` [PATCH 00/13] fpga: " Xu Yilun
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=017b9e17a0c88b2a633467633d304639e7765926.1703006638.git.u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=hao.wu@intel.com \
--cc=kernel@pengutronix.de \
--cc=linux-fpga@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).