Skip to content

Commit

Permalink
PM / Runtime: Fix error path for prepare
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed Nov 13, 2013
1 parent ea30994 commit aa1b9f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,9 @@ static int device_prepare(struct device *dev, pm_message_t state)

device_unlock(dev);

if (error)
pm_runtime_put(dev);

return error;
}

Expand Down

0 comments on commit aa1b9f1

Please sign in to comment.