summaryrefslogtreecommitdiffstats
path: root/drivers/fpga/altera-hps2fpga.c
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2021-11-19 02:55:52 +0100
committerMoritz Fischer <mdf@kernel.org>2021-11-28 23:02:13 +0100
commit0d70af3c2530a70f1b2c197feaa63fbd3548ce34 (patch)
tree59c77d021df097a8d8fc8129661d2b1533e222d8 /drivers/fpga/altera-hps2fpga.c
parentfpga: mgr: Use standard dev_release for class driver (diff)
downloadlinux-0d70af3c2530a70f1b2c197feaa63fbd3548ce34.tar.xz
linux-0d70af3c2530a70f1b2c197feaa63fbd3548ce34.zip
fpga: bridge: Use standard dev_release for class driver
The FPGA bridge class driver data structure is being treated as a managed resource instead of using the standard dev_release call-back function to release the class data structure. This change removes the managed resource code and combines the create() and register() functions into a single register() function. Signed-off-by: Russ Weight <russell.h.weight@intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Acked-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Moritz Fischer <mdf@kernel.org>
Diffstat (limited to 'drivers/fpga/altera-hps2fpga.c')
-rw-r--r--drivers/fpga/altera-hps2fpga.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
index 77b95f251821..aa758426c22b 100644
--- a/drivers/fpga/altera-hps2fpga.c
+++ b/drivers/fpga/altera-hps2fpga.c
@@ -180,19 +180,15 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
}
}
- br = devm_fpga_bridge_create(dev, priv->name,
- &altera_hps2fpga_br_ops, priv);
- if (!br) {
- ret = -ENOMEM;
+ br = fpga_bridge_register(dev, priv->name,
+ &altera_hps2fpga_br_ops, priv);
+ if (IS_ERR(br)) {
+ ret = PTR_ERR(br);
goto err;
}
platform_set_drvdata(pdev, br);
- ret = fpga_bridge_register(br);
- if (ret)
- goto err;
-
return 0;
err: