mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
fpga: fpga-mgr: ice40-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-5-mdf@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
83eb4fbdcf
commit
7027b7305d
@@ -183,18 +183,7 @@ static int ice40_fpga_probe(struct spi_device *spi)
|
|||||||
if (!mgr)
|
if (!mgr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
spi_set_drvdata(spi, mgr);
|
return devm_fpga_mgr_register(dev, mgr);
|
||||||
|
|
||||||
return fpga_mgr_register(mgr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ice40_fpga_remove(struct spi_device *spi)
|
|
||||||
{
|
|
||||||
struct fpga_manager *mgr = spi_get_drvdata(spi);
|
|
||||||
|
|
||||||
fpga_mgr_unregister(mgr);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id ice40_fpga_of_match[] = {
|
static const struct of_device_id ice40_fpga_of_match[] = {
|
||||||
@@ -205,7 +194,6 @@ MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);
|
|||||||
|
|
||||||
static struct spi_driver ice40_fpga_driver = {
|
static struct spi_driver ice40_fpga_driver = {
|
||||||
.probe = ice40_fpga_probe,
|
.probe = ice40_fpga_probe,
|
||||||
.remove = ice40_fpga_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ice40spi",
|
.name = "ice40spi",
|
||||||
.of_match_table = of_match_ptr(ice40_fpga_of_match),
|
.of_match_table = of_match_ptr(ice40_fpga_of_match),
|
||||||
|
Reference in New Issue
Block a user