mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 23:29:46 +00:00
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>
This commit is contained in:
parent
57d9352b6c
commit
c9d754d6f7
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user