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)
commit72368d122c7479aa6e14fbbd334717b8a0c157a6
treecf521f1fb24d4a77c5b1dc9df0d896d9f0db9729
parenta27a9ab706c8f5bb8bbd320d2e9c5d089e380c6a
cpufreq: Clean up after a failing light-weight initialization

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