diff options
author | Alan Tull <atull@kernel.org> | 2018-10-15 18:20:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-16 05:13:50 -0400 |
commit | 084181fe8cc7472695b907f0018f4cd00934cb12 (patch) | |
tree | 812b6c10de92d91bccfdec2da621abacc2745c4d /drivers/fpga/socfpga.c | |
parent | 1c87dc897b8c8ace3aa4480fa29ef6439dabb3ab (diff) |
fpga: mgr: add devm_fpga_mgr_create
Add devm_fpga_mgr_create() which is the managed
version of fpga_mgr_create().
Change current FPGA manager drivers to use
devm_fpga_mgr_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/socfpga.c')
-rw-r--r-- | drivers/fpga/socfpga.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/fpga/socfpga.c b/drivers/fpga/socfpga.c index 959d71f26896..4a8a2fcd4e6c 100644 --- a/drivers/fpga/socfpga.c +++ b/drivers/fpga/socfpga.c | |||
@@ -571,18 +571,14 @@ static int socfpga_fpga_probe(struct platform_device *pdev) | |||
571 | if (ret) | 571 | if (ret) |
572 | return ret; | 572 | return ret; |
573 | 573 | ||
574 | mgr = fpga_mgr_create(dev, "Altera SOCFPGA FPGA Manager", | 574 | mgr = devm_fpga_mgr_create(dev, "Altera SOCFPGA FPGA Manager", |
575 | &socfpga_fpga_ops, priv); | 575 | &socfpga_fpga_ops, priv); |
576 | if (!mgr) | 576 | if (!mgr) |
577 | return -ENOMEM; | 577 | return -ENOMEM; |
578 | 578 | ||
579 | platform_set_drvdata(pdev, mgr); | 579 | platform_set_drvdata(pdev, mgr); |
580 | 580 | ||
581 | ret = fpga_mgr_register(mgr); | 581 | return fpga_mgr_register(mgr); |
582 | if (ret) | ||
583 | fpga_mgr_free(mgr); | ||
584 | |||
585 | return ret; | ||
586 | } | 582 | } |
587 | 583 | ||
588 | static int socfpga_fpga_remove(struct platform_device *pdev) | 584 | static int socfpga_fpga_remove(struct platform_device *pdev) |