summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorMoritz Fischer <mdf@kernel.org>2020-11-15 11:51:22 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-01 18:49:32 +0100
commita3b79b2a58f0862378817998eecc023e93ab5a46 (patch)
tree15005b8a7295f26e391472d1841a627c2b0c1179 /drivers/fpga
parent7027b7305d16f7b4db36139cc0c063e5d2fd216d (diff)
fpga: fpga-mgr: machxo2-spi: 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-6-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/machxo2-spi.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/fpga/machxo2-spi.c b/drivers/fpga/machxo2-spi.c
index b316369156fe..114a64d2b7a4 100644
--- a/drivers/fpga/machxo2-spi.c
+++ b/drivers/fpga/machxo2-spi.c
@@ -371,18 +371,7 @@ static int machxo2_spi_probe(struct spi_device *spi)
if (!mgr)
return -ENOMEM;
- spi_set_drvdata(spi, mgr);
-
- return fpga_mgr_register(mgr);
-}
-
-static int machxo2_spi_remove(struct spi_device *spi)
-{
- struct fpga_manager *mgr = spi_get_drvdata(spi);
-
- fpga_mgr_unregister(mgr);
-
- return 0;
+ return devm_fpga_mgr_register(dev, mgr);
}
static const struct of_device_id of_match[] = {
@@ -403,7 +392,6 @@ static struct spi_driver machxo2_spi_driver = {
.of_match_table = of_match_ptr(of_match),
},
.probe = machxo2_spi_probe,
- .remove = machxo2_spi_remove,
.id_table = lattice_ids,
};