summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorMoritz Fischer <mdf@kernel.org>2020-11-15 11:51:26 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-01 18:49:32 +0100
commit2630fa8d00318346b73f692d90863468d8cfe27d (patch)
treea3bf668e44c9638c593ba0ca3da6df4436ab1d10 /drivers/fpga
parentf4ce435b732adfcca1dc70fd3050f9ffc80d9add (diff)
fpga: fpga-mgr: zynqmp: Simplify registration
Simplify registration using new devm_fpga_mgr_register() API. Reviewed-by: Tom Rix <trix@redhat.com> Signed-off-by: Moritz Fischer <mdf@kernel.org> Link: https://lore.kernel.org/r/20201115195127.284487-10-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/zynqmp-fpga.c21
1 files changed, 1 insertions, 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),