diff options
author | Alan Tull <atull@kernel.org> | 2018-10-16 00:20:02 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-16 11:13:50 +0200 |
commit | 213befe049c70cfcfcbb4f6010bd5276dbc1f7b9 (patch) | |
tree | aec320c32e568e2b05b4a9280c45f1e3e6b7daaa /drivers/fpga/dfl-fme-br.c | |
parent | fpga: mgr: add devm_fpga_mgr_create (diff) | |
download | linux-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/dfl-fme-br.c')
-rw-r--r-- | drivers/fpga/dfl-fme-br.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/fpga/dfl-fme-br.c b/drivers/fpga/dfl-fme-br.c index 7cc041def8b3..3ff9f3a687ce 100644 --- a/drivers/fpga/dfl-fme-br.c +++ b/drivers/fpga/dfl-fme-br.c @@ -61,7 +61,6 @@ static int fme_br_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct fme_br_priv *priv; struct fpga_bridge *br; - int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -69,18 +68,14 @@ static int fme_br_probe(struct platform_device *pdev) priv->pdata = dev_get_platdata(dev); - br = fpga_bridge_create(dev, "DFL FPGA FME Bridge", - &fme_bridge_ops, priv); + br = devm_fpga_bridge_create(dev, "DFL FPGA FME Bridge", + &fme_bridge_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 fpga_bridge_register(br); } static int fme_br_remove(struct platform_device *pdev) |