Merge series "spi: spi-sun6i: One fix and some improvements" from Marc Kleine-Budde...
[platform/kernel/linux-starfive.git] / drivers / spi / spi-pxa2xx.c
index 179416b..0040362 100644 (file)
@@ -1890,7 +1890,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;
@@ -1899,7 +1899,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:
@@ -1922,6 +1921,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);