mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a3b79b2a58
commit
20e8963f4f
@@ -576,18 +576,7 @@ static int socfpga_fpga_probe(struct platform_device *pdev)
|
|||||||
if (!mgr)
|
if (!mgr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, mgr);
|
return devm_fpga_mgr_register(dev, 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
@@ -601,7 +590,6 @@ MODULE_DEVICE_TABLE(of, socfpga_fpga_of_match);
|
|||||||
|
|
||||||
static struct platform_driver socfpga_fpga_driver = {
|
static struct platform_driver socfpga_fpga_driver = {
|
||||||
.probe = socfpga_fpga_probe,
|
.probe = socfpga_fpga_probe,
|
||||||
.remove = socfpga_fpga_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "socfpga_fpga_manager",
|
.name = "socfpga_fpga_manager",
|
||||||
.of_match_table = of_match_ptr(socfpga_fpga_of_match),
|
.of_match_table = of_match_ptr(socfpga_fpga_of_match),
|
||||||
|
Reference in New Issue
Block a user