diff mbox series

[-next,3/3] spi: geni-qcom: Use devm_spi_register_controller()

Message ID 20240904021943.2076343-4-ruanjinjie@huawei.com
State New
Headers show
Series [-next,1/3] spi: geni-qcom: Use devm_request_irq() helper | expand

Commit Message

Jinjie Ruan Sept. 4, 2024, 2:19 a.m. UTC
Use devm_spi_register_controller() in the Qualcomm GENI based SPI
controller driver, which avoid having to manually call
spi_unregister_controller() in the remove function.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-geni-qcom.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index e5bece7be892..fecb6f15de7b 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1148,7 +1148,7 @@  static int spi_geni_probe(struct platform_device *pdev)
 	if (ret)
 		goto spi_geni_release_dma;
 
-	ret = spi_register_controller(spi);
+	ret = devm_spi_register_controller(dev, spi);
 	if (ret)
 		goto spi_geni_release_dma;
 
@@ -1164,9 +1164,6 @@  static void spi_geni_remove(struct platform_device *pdev)
 	struct spi_controller *spi = platform_get_drvdata(pdev);
 	struct spi_geni_master *mas = spi_controller_get_devdata(spi);
 
-	/* Unregister _before_ disabling pm_runtime() so we stop transfers */
-	spi_unregister_controller(spi);
-
 	spi_geni_release_dma_chan(mas);
 }