Merge back earlier 'pm-cpufreq' material.
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 17 Mar 2014 12:51:39 +0000 (13:51 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 17 Mar 2014 12:51:39 +0000 (13:51 +0100)
1  2 
drivers/cpufreq/cpufreq.c

index 199b52b7c3e1ad6e9d00102905a215137901b71d,571723b338f9066e8fd1e85232fdb2faef3418cb..2677ff1c0a2cbfeb30252c5773aa5ec52b735148
@@@ -2143,10 -2148,15 +2148,15 @@@ int cpufreq_update_policy(unsigned int 
         * BIOS might change freq behind our back
         * -> ask driver for current freq and notify governors about a change
         */
 -      if (cpufreq_driver->get) {
 +      if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
                new_policy.cur = cpufreq_driver->get(cpu);
+               if (WARN_ON(!new_policy.cur)) {
+                       ret = -EIO;
+                       goto no_policy;
+               }
                if (!policy->cur) {
-                       pr_debug("Driver did not initialize current freq");
+                       pr_debug("Driver did not initialize current freq\n");
                        policy->cur = new_policy.cur;
                } else {
                        if (policy->cur != new_policy.cur && has_target())