fpga: fpga-mgr: xilinx-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-9-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d6530c0a48
commit
f4ce435b73
|
@ -259,18 +259,7 @@ static int xilinx_spi_probe(struct spi_device *spi)
|
|||
if (!mgr)
|
||||
return -ENOMEM;
|
||||
|
||||
spi_set_drvdata(spi, mgr);
|
||||
|
||||
return fpga_mgr_register(mgr);
|
||||
}
|
||||
|
||||
static int xilinx_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(&spi->dev, mgr);
|
||||
}
|
||||
|
||||
static const struct of_device_id xlnx_spi_of_match[] = {
|
||||
|
@ -285,7 +274,6 @@ static struct spi_driver xilinx_slave_spi_driver = {
|
|||
.of_match_table = of_match_ptr(xlnx_spi_of_match),
|
||||
},
|
||||
.probe = xilinx_spi_probe,
|
||||
.remove = xilinx_spi_remove,
|
||||
};
|
||||
|
||||
module_spi_driver(xilinx_slave_spi_driver)
|
||||
|
|
Loading…
Reference in New Issue