BACKPORT: PM / sleep: Go direct_complete if driver has no callbacks
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 7 Jan 2016 15:46:14 +0000 (16:46 +0100)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 11 Jul 2016 07:13:04 +0000 (12:43 +0530)
commit1e54ec8789d18332ce5b13152d82c0d8e2383ae4
tree781ecb246ab314c8a71af79500ea9b11b209f177
parent6a32bc7e0c132ca51106f04165724dc776a81ce2
BACKPORT: PM / sleep: Go direct_complete if driver has no callbacks

Backport notes: This resolves clk warnings in the designware i2c
driver on HiKey seen during suspend/resume.

Cherrypicked from: aa8e54b559479d0cb7eb632ba443b8cacd20cd4b

If a suitable prepare callback cannot be found for a given device and
its driver has no PM callbacks at all, assume that it can go direct to
complete when the system goes to sleep.

The reason for this is that there's lots of devices in a system that do
no PM at all and there's no reason for them to prevent their ancestors
to do direct_complete if they can support it.

Change-Id: Ia773afb4b266f012336b99fc8cf87453839e078b
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[jstultz: Backported to 4.4]
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/base/dd.c
drivers/base/power/main.c
drivers/base/power/power.h
include/linux/pm.h