[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201004051423.75879-10-mdf@kernel.org>
Date: Sat, 3 Oct 2020 22:14:22 -0700
From: Moritz Fischer <mdf@...nel.org>
To: linux-fpga@...r.kernel.org
Cc: trix@...hat.com, hao.wu@...el.com, michal.simek@...inx.com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
russell.h.weight@...el.com, matthew.gerlach@...el.com,
Moritz Fischer <mdf@...nel.org>
Subject: [PATCH 09/10] fpga: fpga-mgr: zynqmp: Simplify registration
Simplify registration using new devm_fpga_mgr_register() API.
Signed-off-by: Moritz Fischer <mdf@...nel.org>
---
drivers/fpga/zynqmp-fpga.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
index 4a1139e05280..125743c9797f 100644
--- a/drivers/fpga/zynqmp-fpga.c
+++ b/drivers/fpga/zynqmp-fpga.c
@@ -95,7 +95,6 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct zynqmp_fpga_priv *priv;
struct fpga_manager *mgr;
- int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -108,24 +107,7 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)
if (!mgr)
return -ENOMEM;
- platform_set_drvdata(pdev, mgr);
-
- ret = fpga_mgr_register(mgr);
- if (ret) {
- dev_err(dev, "unable to register FPGA manager");
- return ret;
- }
-
- return 0;
-}
-
-static int zynqmp_fpga_remove(struct platform_device *pdev)
-{
- struct fpga_manager *mgr = platform_get_drvdata(pdev);
-
- fpga_mgr_unregister(mgr);
-
- return 0;
+ return devm_fpga_mgr_register(dev, mgr);
}
static const struct of_device_id zynqmp_fpga_of_match[] = {
@@ -137,7 +119,6 @@ MODULE_DEVICE_TABLE(of, zynqmp_fpga_of_match);
static struct platform_driver zynqmp_fpga_driver = {
.probe = zynqmp_fpga_probe,
- .remove = zynqmp_fpga_remove,
.driver = {
.name = "zynqmp_fpga_manager",
.of_match_table = of_match_ptr(zynqmp_fpga_of_match),
--
2.28.0
Powered by blists - more mailing lists