mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 05:01:48 +00:00
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. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
ea309944e2
commit
aa1b9f13b3
@ -1277,6 +1277,9 @@ static int device_prepare(struct device *dev, pm_message_t state)
|
|||||||
|
|
||||||
device_unlock(dev);
|
device_unlock(dev);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
pm_runtime_put(dev);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user