summaryrefslogtreecommitdiffstats
path: root/drivers/fpga
diff options
context:
space:
mode:
authorMoritz Fischer <mdf@kernel.org>2020-11-15 11:51:23 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-01 18:49:32 +0100
commit20e8963f4f38a9bfaffa74198efae3eb9a8bb7ed (patch)
tree3271b4de93c2360afffb8b6290d1d451e37a9530 /drivers/fpga
parenta3b79b2a58f0862378817998eecc023e93ab5a46 (diff)
downloadlinux-20e8963f4f38a9bfaffa74198efae3eb9a8bb7ed.tar.gz
linux-20e8963f4f38a9bfaffa74198efae3eb9a8bb7ed.tar.bz2
linux-20e8963f4f38a9bfaffa74198efae3eb9a8bb7ed.zip
fpga: fpga-mgr: socfpga: Simplify registration
Simplify registration using new devm_fpga_mgr_register() API. Reviewed-by: Tom Rix <trix@redhat.com> Signed-off-by: Moritz Fischer <mdf@kernel.org> Link: https://lore.kernel.org/r/20201115195127.284487-7-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/socfpga.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/fpga/socfpga.c b/drivers/fpga/socfpga.c
index 4a8a2fcd4e6c..1f467173fc1f 100644
--- a/drivers/fpga/socfpga.c
+++ b/drivers/fpga/socfpga.c
@@ -576,18 +576,7 @@ static int socfpga_fpga_probe(struct platform_device *pdev)
if (!mgr)
return -ENOMEM;
- platform_set_drvdata(pdev, mgr);
-
- return fpga_mgr_register(mgr);
-}
-
-static int socfpga_fpga_remove(struct platform_device *pdev)
-{
- struct fpga_manager *mgr = platform_get_drvdata(pdev);
-
- fpga_mgr_unregister(mgr);
-
- return 0;
+ return devm_fpga_mgr_register(dev, mgr);
}
#ifdef CONFIG_OF
@@ -601,7 +590,6 @@ MODULE_DEVICE_TABLE(of, socfpga_fpga_of_match);
static struct platform_driver socfpga_fpga_driver = {
.probe = socfpga_fpga_probe,
- .remove = socfpga_fpga_remove,
.driver = {
.name = "socfpga_fpga_manager",
.of_match_table = of_match_ptr(socfpga_fpga_of_match),