summaryrefslogtreecommitdiff
path: root/drivers/fpga/of-fpga-region.c
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2021-11-18 17:55:53 -0800
committerMoritz Fischer <mdf@kernel.org>2021-11-28 14:02:41 -0800
commit8886a579744fbfa53e69aa453ed10ae3b1f9abac (patch)
tree76f7e8e3349ebd0f94e811811ef959f5696b1a37 /drivers/fpga/of-fpga-region.c
parent0d70af3c2530a70f1b2c197feaa63fbd3548ce34 (diff)
fpga: region: Use standard dev_release for class driver
The FPGA region 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() or register_full() function. The register_full() function accepts an info data structure to provide flexibility in passing optional parameters. The register() function supports the current parameter list for users that don't require the use of optional parameters. 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/of-fpga-region.c')
-rw-r--r--drivers/fpga/of-fpga-region.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index e3c25576b6b9..9c662db1c508 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -405,16 +405,12 @@ static int of_fpga_region_probe(struct platform_device *pdev)
if (IS_ERR(mgr))
return -EPROBE_DEFER;
- region = devm_fpga_region_create(dev, mgr, of_fpga_region_get_bridges);
- if (!region) {
- ret = -ENOMEM;
+ region = fpga_region_register(dev, mgr, of_fpga_region_get_bridges);
+ if (IS_ERR(region)) {
+ ret = PTR_ERR(region);
goto eprobe_mgr_put;
}
- ret = fpga_region_register(region);
- if (ret)
- goto eprobe_mgr_put;
-
of_platform_populate(np, fpga_region_of_match, NULL, &region->dev);
platform_set_drvdata(pdev, region);