summaryrefslogtreecommitdiff
path: root/drivers/fpga/dfl-fme-region.c
diff options
context:
space:
mode:
authorAlan Tull <atull@kernel.org>2018-10-15 17:20:03 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-16 11:13:50 +0200
commitfea82b7f6670002ff36bf1bc77d0345b0b2f2d1c (patch)
treeeeed3d9f54d90d5f01ea84e1ebdd2d05b3553667 /drivers/fpga/dfl-fme-region.c
parent213befe049c70cfcfcbb4f6010bd5276dbc1f7b9 (diff)
downloadlwn-fea82b7f6670002ff36bf1bc77d0345b0b2f2d1c.tar.gz
lwn-fea82b7f6670002ff36bf1bc77d0345b0b2f2d1c.zip
fpga: add devm_fpga_region_create
Add devm_fpga_region_create() which is the managed version of fpga_region_create(). Change current region drivers to use devm_fpga_region_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-region.c')
-rw-r--r--drivers/fpga/dfl-fme-region.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c
index 51a5ac2293a7..ec134ec93f08 100644
--- a/drivers/fpga/dfl-fme-region.c
+++ b/drivers/fpga/dfl-fme-region.c
@@ -39,7 +39,7 @@ static int fme_region_probe(struct platform_device *pdev)
if (IS_ERR(mgr))
return -EPROBE_DEFER;
- region = fpga_region_create(dev, mgr, fme_region_get_bridges);
+ region = devm_fpga_region_create(dev, mgr, fme_region_get_bridges);
if (!region) {
ret = -ENOMEM;
goto eprobe_mgr_put;
@@ -51,14 +51,12 @@ static int fme_region_probe(struct platform_device *pdev)
ret = fpga_region_register(region);
if (ret)
- goto region_free;
+ goto eprobe_mgr_put;
dev_dbg(dev, "DFL FME FPGA Region probed\n");
return 0;
-region_free:
- fpga_region_free(region);
eprobe_mgr_put:
fpga_mgr_put(mgr);
return ret;