fpga: region: Use standard dev_release for class driver
[ Upstream commit 8886a579744fbfa53e69aa453ed10ae3b1f9abac ] 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> Stable-dep-of: b7c0e1ecee40 ("fpga: region: add owner module and take its refcount") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
b089bb733c
commit
af02dec83a
@@ -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, ®ion->dev);
|
||||
platform_set_drvdata(pdev, region);
|
||||
|
||||
|
Reference in New Issue
Block a user