diff options
author | Moritz Fischer <mdf@kernel.org> | 2020-11-15 20:51:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-01 18:49:32 +0100 |
commit | c9d754d6f71c780caa2d496b39e54f86a6622a0d (patch) | |
tree | f6f22e3488b04867ec3f60dba0ba3aae4b3619ae /drivers/fpga | |
parent | fpga: fpga-mgr: Add devm_fpga_mgr_register() API (diff) | |
download | linux-c9d754d6f71c780caa2d496b39e54f86a6622a0d.tar.xz linux-c9d754d6f71c780caa2d496b39e54f86a6622a0d.zip |
fpga: fpga-mgr: altera-ps-spi: Simplify registration
Simplify registration by 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-3-mdf@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r-- | drivers/fpga/altera-ps-spi.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/fpga/altera-ps-spi.c b/drivers/fpga/altera-ps-spi.c index 0221dee8dd4c..23bfd4d1ad0f 100644 --- a/drivers/fpga/altera-ps-spi.c +++ b/drivers/fpga/altera-ps-spi.c @@ -307,18 +307,7 @@ static int altera_ps_probe(struct spi_device *spi) if (!mgr) return -ENOMEM; - spi_set_drvdata(spi, mgr); - - return fpga_mgr_register(mgr); -} - -static int altera_ps_remove(struct spi_device *spi) -{ - struct fpga_manager *mgr = spi_get_drvdata(spi); - - fpga_mgr_unregister(mgr); - - return 0; + return devm_fpga_mgr_register(&spi->dev, mgr); } static const struct spi_device_id altera_ps_spi_ids[] = { @@ -337,7 +326,6 @@ static struct spi_driver altera_ps_driver = { }, .id_table = altera_ps_spi_ids, .probe = altera_ps_probe, - .remove = altera_ps_remove, }; module_spi_driver(altera_ps_driver) |