[PATCH 07/14] spi: axi-spi-engine: use devm_spi_register_controller()
From: David Lechner
Date: Fri Nov 17 2023 - 15:14:13 EST
This replaces spi_register_controller() with
devm_spi_register_controller() in the AXI SPI Engine driver. This
saves us from having to call spi_unregister_controller() in the
remove function.
The remove function is also removed since it is no longer needed.
Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
---
drivers/spi/spi-axi-spi-engine.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 81d7352d2b8b..819744246952 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -532,7 +532,7 @@ static int spi_engine_probe(struct platform_device *pdev)
host->transfer_one_message = spi_engine_transfer_one_message;
host->num_chipselect = 8;
- ret = spi_register_controller(host);
+ ret = devm_spi_register_controller(&pdev->dev, host);
if (ret)
return ret;
@@ -541,13 +541,6 @@ static int spi_engine_probe(struct platform_device *pdev)
return 0;
}
-static void spi_engine_remove(struct platform_device *pdev)
-{
- struct spi_controller *host = platform_get_drvdata(pdev);
-
- spi_unregister_controller(host);
-}
-
static const struct of_device_id spi_engine_match_table[] = {
{ .compatible = "adi,axi-spi-engine-1.00.a" },
{ },
@@ -556,7 +549,6 @@ MODULE_DEVICE_TABLE(of, spi_engine_match_table);
static struct platform_driver spi_engine_driver = {
.probe = spi_engine_probe,
- .remove_new = spi_engine_remove,
.driver = {
.name = "spi-engine",
.of_match_table = spi_engine_match_table,
--
2.42.0