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>
This commit is contained in:
committed by
Moritz Fischer
parent
4ba0b2c294
commit
0d70af3c25
@ -140,22 +140,17 @@ static int xlnx_pr_decoupler_probe(struct platform_device *pdev)
|
||||
|
||||
clk_disable(priv->clk);
|
||||
|
||||
br = devm_fpga_bridge_create(&pdev->dev, priv->ipconfig->name,
|
||||
&xlnx_pr_decoupler_br_ops, priv);
|
||||
if (!br) {
|
||||
err = -ENOMEM;
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, br);
|
||||
|
||||
err = fpga_bridge_register(br);
|
||||
if (err) {
|
||||
br = fpga_bridge_register(&pdev->dev, priv->ipconfig->name,
|
||||
&xlnx_pr_decoupler_br_ops, priv);
|
||||
if (IS_ERR(br)) {
|
||||
err = PTR_ERR(br);
|
||||
dev_err(&pdev->dev, "unable to register %s",
|
||||
priv->ipconfig->name);
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, br);
|
||||
|
||||
return 0;
|
||||
|
||||
err_clk:
|
||||
|
Reference in New Issue
Block a user