summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-11-13 15:45:03 +0100
committerMandar Padmawar <mpadmawar@nvidia.com>2014-06-18 04:41:49 -0700
commit41420e06b4a2ce4e02427dd84cd652e5d34f50f5 (patch)
treeb0323503afc925647b41f60fa149862c1b03348a /drivers/base
parenta73b2ab145191c20619750eccc815682eccde774 (diff)
PM / Runtime: Fix error path for prepare
If a device prepare callback for some reason would fail, the PM core prevented the device from going inactive forever. In this case, to reverse the pm_runtime_get_noresume() we invokes the asyncronous pm_runtime_put(), thus restoring the usage count. bug 1518244 Change-Id: Ia4984630e71abeb55ef90a19799d1fea700b2148 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit aa1b9f13b3346352455bfdc343ecff7667b84ff5) Signed-off-by: Allen Yu <alleny@nvidia.com> Reviewed-on: http://git-master/r/423999 Reviewed-on: http://git-master/r/424177 Reviewed-by: Shridhar Rasal <srasal@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 6a33dd85c044..7460ad1e1d8a 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1334,6 +1334,9 @@ static int device_prepare(struct device *dev, pm_message_t state)
device_unlock(dev);
+ if (error)
+ pm_runtime_put(dev);
+
return error;
}