summaryrefslogtreecommitdiffstats
path: root/drivers/fpga/altera-freeze-bridge.c
diff options
context:
space:
mode:
authorAlan Tull <atull@kernel.org>2018-10-16 00:20:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-16 11:13:50 +0200
commit213befe049c70cfcfcbb4f6010bd5276dbc1f7b9 (patch)
treeaec320c32e568e2b05b4a9280c45f1e3e6b7daaa /drivers/fpga/altera-freeze-bridge.c
parentfpga: mgr: add devm_fpga_mgr_create (diff)
downloadlinux-213befe049c70cfcfcbb4f6010bd5276dbc1f7b9.tar.xz
linux-213befe049c70cfcfcbb4f6010bd5276dbc1f7b9.zip
fpga: bridge: add devm_fpga_bridge_create
Add devm_fpga_bridge_create() which is the managed version of fpga_bridge_create(). Change current bridge drivers to use devm_fpga_bridge_create(). Signed-off-by: Alan Tull <atull@kernel.org> Suggested-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga/altera-freeze-bridge.c')
-rw-r--r--drivers/fpga/altera-freeze-bridge.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/fpga/altera-freeze-bridge.c b/drivers/fpga/altera-freeze-bridge.c
index ffd586c48ecf..dd58c4aea92e 100644
--- a/drivers/fpga/altera-freeze-bridge.c
+++ b/drivers/fpga/altera-freeze-bridge.c
@@ -213,7 +213,6 @@ static int altera_freeze_br_probe(struct platform_device *pdev)
struct fpga_bridge *br;
struct resource *res;
u32 status, revision;
- int ret;
if (!np)
return -ENODEV;
@@ -245,20 +244,14 @@ static int altera_freeze_br_probe(struct platform_device *pdev)
priv->base_addr = base_addr;
- br = fpga_bridge_create(dev, FREEZE_BRIDGE_NAME,
- &altera_freeze_br_br_ops, priv);
+ br = devm_fpga_bridge_create(dev, FREEZE_BRIDGE_NAME,
+ &altera_freeze_br_br_ops, priv);
if (!br)
return -ENOMEM;
platform_set_drvdata(pdev, br);
- ret = fpga_bridge_register(br);
- if (ret) {
- fpga_bridge_free(br);
- return ret;
- }
-
- return 0;
+ return fpga_bridge_register(br);
}
static int altera_freeze_br_remove(struct platform_device *pdev)