spi: cadence: change sequence of calling runtime_enable
authorNaga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Tue, 8 Aug 2017 08:59:33 +0000 (10:59 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 8 Aug 2017 09:43:16 +0000 (10:43 +0100)
call pm_runtime_enable after set_active other wise it will
enable clock always.

Signed-off-by: Naga Sureshkumar Relli <nagasure@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence.c

index f0b5c7b91f37b0921410f599cf485a775152e691..5e02f9b91688cd442e8f4ee6e4db4c4deca642df 100644 (file)
@@ -576,10 +576,10 @@ static int cdns_spi_probe(struct platform_device *pdev)
                goto clk_dis_apb;
        }
 
-       pm_runtime_enable(&pdev->dev);
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
        pm_runtime_set_active(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
 
        ret = of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs);
        if (ret < 0)