mmc: mmci: Do pm_runtime_put() after the host has been added
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 11 Dec 2014 13:35:55 +0000 (14:35 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 19 Jan 2015 08:56:23 +0000 (09:56 +0100)
Previously the pm_runtime_put() caused the device to be runtime PM
suspended, but then immediately being resumed when we add the host.

Prevent this unnecessary runtime PM suspend/resume cycle during
->probe() by moving the call to pm_runtime_put() after mmc_add_host().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci.c

index 8232e9a02d407ca96495704fd266f02b5fd6fc8e..88aefa6fa8b117685ceb70c7a27e73ec3b5d9d5e 100644 (file)
@@ -1739,10 +1739,10 @@ static int mmci_probe(struct amba_device *dev,
 
        pm_runtime_set_autosuspend_delay(&dev->dev, 50);
        pm_runtime_use_autosuspend(&dev->dev);
-       pm_runtime_put(&dev->dev);
 
        mmc_add_host(mmc);
 
+       pm_runtime_put(&dev->dev);
        return 0;
 
  clk_disable: