Merge remote-tracking branch 'spi/for-5.8' into spi-next
[sfrench/cifs-2.6.git] / drivers / spi / spi-pxa2xx.c
index 20dcbd35611a7e3c698595868500430bb9c0f5b2..6721910e5f2aaaf44682e9825f9ef3871eed6060 100644 (file)
@@ -1885,7 +1885,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 
        /* Register with the SPI framework */
        platform_set_drvdata(pdev, drv_data);
-       status = devm_spi_register_controller(&pdev->dev, controller);
+       status = spi_register_controller(controller);
        if (status != 0) {
                dev_err(&pdev->dev, "problem registering spi controller\n");
                goto out_error_pm_runtime_enabled;
@@ -1894,7 +1894,6 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        return status;
 
 out_error_pm_runtime_enabled:
-       pm_runtime_put_noidle(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
 out_error_clock_enabled:
@@ -1917,6 +1916,8 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
 
        pm_runtime_get_sync(&pdev->dev);
 
+       spi_unregister_controller(drv_data->controller);
+
        /* Disable the SSP at the peripheral and SOC level */
        pxa2xx_spi_write(drv_data, SSCR0, 0);
        clk_disable_unprepare(ssp->clk);