cpufreq: Clean up after a failing light-weight initialization
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Dec 2013 00:07:11 +0000 (01:07 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 29 Dec 2013 14:30:36 +0000 (15:30 +0100)
If cpufreq_policy_restore() returns NULL during system resume,
__cpufreq_add_dev() should just fall back to the full initialization
instead of returning an error, because that may actually make things
work.  Moreover, it should not leave stale fallback data behind after
it has failed to restore a previously existing policy.

This change is based on Viresh Kumar's work.

Fixes: 5302c3fb2e62 ("cpufreq: Perform light-weight init/teardown during suspend/resume")
Reported-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
drivers/cpufreq/cpufreq.c

Simple merge