PM / Runtime: Don't allow to suspend a device with an active child
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Oct 2016 18:17:01 +0000 (20:17 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Nov 2016 14:49:37 +0000 (15:49 +0100)
commita8636c89648ab12e59d8f3aa667ec76fc96fd643
tree7a4faf0aa71ffacf89e27c878803cec2137356dc
parent8812872960824681147fad051e6e1406fdfa07f9
PM / Runtime: Don't allow to suspend a device with an active child

When resuming a device in __pm_runtime_set_status(), the prerequisite is
that its parent must already be active, else an error code is returned and
the device's status remains suspended.

When suspending a device there is no similar constraints being validated.
Let's change this to make the behaviour consistent, by not allowing to
suspend a device with an active child, unless it has been explicitly set to
ignore its children.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c