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@xxxxxxxxxx> --- drivers/spi/spi-geni-qcom.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); } -- 2.34.1