]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fpga: fpga-mgr: dfl-fme-mgr: Simplify registration
authorMoritz Fischer <mdf@kernel.org>
Sun, 15 Nov 2020 19:51:20 +0000 (11:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Dec 2020 17:49:32 +0000 (18:49 +0100)
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-4-mdf@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/dfl-fme-mgr.c

index b3f7eee3c93f629f155974d1ff0a165191f64339..d5861d13b306904ccb66b8e9614f8be107240d58 100644 (file)
@@ -314,18 +314,8 @@ static int fme_mgr_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        mgr->compat_id = compat_id;
-       platform_set_drvdata(pdev, mgr);
 
-       return fpga_mgr_register(mgr);
-}
-
-static int fme_mgr_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);
 }
 
 static struct platform_driver fme_mgr_driver = {
@@ -333,7 +323,6 @@ static struct platform_driver fme_mgr_driver = {
                .name    = DFL_FPGA_FME_MGR,
        },
        .probe   = fme_mgr_probe,
-       .remove  = fme_mgr_remove,
 };
 
 module_platform_driver(fme_mgr_driver);